I’ve created a wordpress menu with wp_nav_menu.
my structure looks like:
- Page
- Category
- Page
- Page
- Page
If I open a post in “Category”, there is no “current” class on the top level of the menu â only on “Category”. Nesting only with pages works fine on multi level menus.
Is there a way to fix that?
1) Either write a custom walker http://codex.wordpress.org/Function_Reference/wp_nav_menu#Using_a_Custom_Walker_Function to add a current class when that category is called;
2) Or, (not the most elegant): find your page ID for the menu item you want –
1000
in the example below – to highlight as current, select that category –is_category
– and then add the current class –addClass
– with jQuery:ahh… found the solution in the wordpress codex. this works fine for me: