• The current(active) menu items work as expected until I go in to a post that has multiple categories selected. Since the menu for my site has been made in the Appearance->Menus admin page as category menu items, when a post has two categories selected that are also in the main navigation both appear with the style of the current menu item.

    Does anyone know how I can limit the menu to only be able to display one that has an active state.

    This is the code to include the menu if it helps:

    <?php wp_nav_menu( array( 'theme_location' => 'mainMenu' ,'container' => false,'container_class'=>'menuHolder','menu_class' => 'menuTop') ); ?>

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter Jordan Neenan

    (@forxs)

    I found another person with the same issue here – no responses to that one though ->

    http://wordpress.org/support/topic/multiple-categories-on-single-post-creating-multiple-current-menu-items?replies=3

    “Hello,

    I have been using wp_nav_menu consisting of multiple categories(pages) and their children(sub-menu) and driving the active menu item through css.

    The issue is that when I have a post with multiple categories, it creates multiple menu items with with the class “current-menu-item” and “current-post-ancestor” assigned to it.

    I would like a way for only the first category of the post to be shown as the “current” menu item.

    should I edit the nav_menu_template.php? or maybe deactivate the second/third category while the menu generates itself and put it back afterwards?

    Thanks in advance,”

Viewing 1 replies (of 1 total)
  • The topic ‘Multiple Active Menu Items’ is closed to new replies.