Dynamic menu based on the categories the post is associated with

On my site, I try to implement a dynamic menu for each post based on the categories the post is associated with. The following sketch shows what I am trying to implement:

However, I have no idea how to succeed in doing this. Of course, here I was thinking of a “mega menu” and the power of dynamic data, but I have no idea how to implement that. Maybe someone of you has an idea?

At first I thought maybe I should go through the menu function of wordpress, but the menu function gets fiddly fast the bigger and more complex it gets.

1 Like

My own choice to solve this was to have a ‘mega-menu’ for each category.

WP-Nav menu = ‘item’, ‘item’, ‘mega-cat1’, ‘mega-cat2’ etc.

For mega-cat1 I chose the template ‘cat1-drop’

In the template ‘cat1-drop’ I created a query to find the posts of the right category. So then posts of cat1 appear under ‘mega-cat1’ automatically.

You need the loop builder. I made one. See the videos for the idea