WordPress.org

Support

Support » Themes and Templates » WordPress navigation/wp_nav_menu not displaying on category pages

WordPress navigation/wp_nav_menu not displaying on category pages

  • lewismalpas

    @lewismalpas

    Hi,

    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:
    http://wordpress.org/support/topic/wp-nav-menu-dissapears-in-category-pages-1?replies=21

    Any help would be greatly appreciated,

    Thanks,
    Lewis.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Zoe

    @aquickstudy

    Can you post a link to the site?

    lewismalpas

    @lewismalpas

    Hi Zoe,

    Thanks for replying, the website can be found here:
    http://www.lewismalpas.co.uk/pickledegg

    Thanks,
    Lewis.

    Zoe

    @aquickstudy

    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?

    lewismalpas

    @lewismalpas

    Hi Zoe,

    Here is the Pastebin for the header:
    http://pastebin.com/az7u047Z

    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,

    Lewis.

    Zoe

    @aquickstudy

    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).

    lewismalpas

    @lewismalpas

    Hi Zoe,

    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:
    http://pastebin.com/x1kNYQTL

    Not exactly sure what the function is doing but I have removed it and everything seems to be working correctly now.

    Thanks,
    Lewis.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WordPress navigation/wp_nav_menu not displaying on category pages’ is closed to new replies.