TransWikia.com

Menu dropdown: dynamically list all posts for category

WordPress Development Asked on February 19, 2021

Situation: I have a wordpress installation where I have two categories:

  • category a
  • category b

Now I have several posts which are either category a or b:

  • post 1 -> category a
  • post 2 -> category a
  • post 3 -> category b
  • etc.

I’d like to create a menu header for my page which has a entry for each category and when hovering one of the entry I’d like to have a dropdown list containing all posts within these categories. So far I haven’t found a solution to get this working using the built in WordPress functionalities (in the admin panel, haven’t tried any manual php coding as I’m using Oxygen Builder for designing and I’d like to use a default WordPress menu) or a plugin which provides this.

So currently I have a menu with two entries and manually add each new post accordingly to one of those entries as a submenu item.

Can anyone help me with this situation? I’m new to WordPress but have some developer background but so far I haven’t found out how to fix this. I have seen some php functions to retrieve all posts for a specific category but how should I insert this into a regular menu so that I can just use it in Oxygen Builder?

What would be my wanted solution:

  • Have a regular wordpress menu with two entries (category a & category b)
  • Each entry has a dynamically populated dropdown/submenu with all posts for the corresponding category
  • No need for manually updating the menu/submenu entries when adding a new post with category a/b

Any help and suggestions are appreciated! Thanks in advance 🙂

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP