wp_nav_menu no current page in some menus
-
First of all, i am a newbie in WordPress and PHP … and this is my first post of a problem, so please let me know if i need to post this elsewhere … .
I have pages with multiple menus that i made using wp_nav_menu custom menus. The primary menu is working fine … it adds current-page classes for page-menu-items or current-menu-item classes for category-menu-items. Next to this ‘primary menu’ I also have a Footer menu and a menu in the sidebar. In these menus the same pages and categories are often repeated … the categories work fine and get current-menu-item classes when they should BUT the pages don’t get a current-page class when needed (and contrary to the primary menu).
In the functions.php i put:
<?php if ( function_exists( 'register_nav_menus' ) ) { register_nav_menus( array( 'footer-menu' => 'Footer Menu', 'primary-menu' => 'Primary Menu', 'secondary-menu' => 'Secondary Menu', 'social-menu' => 'Social Menu', 'side-menu1' => 'Side Menu 1', 'side-menu2' => 'Side Menu 2', 'side-menu3' => 'Side Menu 3', 'side-menu4' => 'Side Menu 4' ) ); } ?>
In the rest i call the menus like so:
<?php wp_nav_menu( array('menu' => 'Primary Menu','container_class' => 'menu-header' )); ?>
<?php wp_nav_menu( array('menu' => 'Footer Menu','container_class' => 'bottom-menu' )); ?>
<?php wp_nav_menu( array( 'menu' => 'Side Menu 1', 'container_class' => 'side-menu' ) ); ?>
I have been searching for ways to find out what is happening (used firebug to find the ‘current’ class …) and i have gone through all the possible information on this forum … but no result except loading seperate css-stylesheets … could somebody suggets an elegant solution? This would be super …
- The topic ‘wp_nav_menu no current page in some menus’ is closed to new replies.