WordPress.org

Ready to get started?Download WordPress

Forums

WordPress navigation/wp_nav_menu not displaying on category pages (7 posts)

  1. lewismalpas
    Member
    Posted 1 year ago #

    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.

  2. Zoe
    Member
    Posted 1 year ago #

    Can you post a link to the site?

  3. lewismalpas
    Member
    Posted 1 year ago #

    Hi Zoe,

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

    Thanks,
    Lewis.

  4. Zoe
    Member
    Posted 1 year ago #

    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?

  5. lewismalpas
    Member
    Posted 1 year ago #

    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.

  6. Zoe
    Member
    Posted 1 year ago #

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

  7. lewismalpas
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic