I have encountered a strange issue which I cannot seem to fix, hopefully someone will be able to shed some light on why this is happening.
I am using wp_nav_menu to display my primary navigation, however on category pages the menu does not display. All of the pages pull in the header using:
<?php get_header(); ?>
My wp_nav_menu looks like this:
<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
I have also tried the solutions found in the following thread however both solutions caused further issues:
Any help would be greatly appreciated,
Thanks for replying, the website can be found here:
What’s in your header.php? (Probably best to post it using http://pastebin.com/). Any conditionals or anything like that? I’m assuming that based on the other thread you already checked for conditionals in both the header.php and functions.php, but just to be sure…
I’m not seeing info about the theme in the files – is it a supported theme?
Here is the Pastebin for the header:
The theme is definitely based on TwentyTen so I presume this has something to do with the problem I am trying to overcome seeing as others have had the same problem (http://wordpress.org/support/topic/wp-nav-menu-dissapears-in-category-pages-1?replies=21)?
Thanks again for your help,
That thread seems to have more to do with custom post types and the nav menu. Are you using custom post types as well? Is there an addition to your functions.php that would relate to the nav menu?
The standard Twenty Ten functions.php doesn’t have anything that would cause this, that I know of (no conditionals or special functions other than registering the menu and providing a fallback if no custom menu is specified).
I am using custom post types but that shouldn’t affect the menu displaying on category pages, especially when you are viewing a category outside of a custom post type…
I think I may of found the function which is causing the menu to disappear, this must be the cause:
Not exactly sure what the function is doing but I have removed it and everything seems to be working correctly now.
- The topic ‘WordPress navigation/wp_nav_menu not displaying on category pages’ is closed to new replies.