I am trying to create a menu structure with a simple concept:
- A horizontal, 1-level deep main menu
- A vertical submenu, that contains children of the current main menu item (2 levels deep)
Of course, the submenu should be shown in the following cases:
- Viewing the main menu item
- Viewing a direct child of the main menu item
- Viewing a descendant of the main menu item (3rd level)
Since I want to keep the menu clean, I need to show the 3rd level for the currently active 2nd level menu item only.
Basically, I want to achieve the same thing as described in this topic: How to show only parents subpages of current page item in vertical menu? - BUT, using wp_nav_menu()
I would be happy to use filters or custom walkers if somebody could point me to a right direction.
The important thing here to notice is that since wp_nav_menu can contain also custom links or category links, the solution should work for all of those cases.