Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Im creating a theme based on blankslate/Bootstrap and having an issue with the main nav appearing on category pages (seems to appear everywhere else ok.).

In header.php:

<div class="collapse navbar-collapse" id="navbar-collapse-1">
                      <?php
                      wp_nav_menu( array(
                      'menu'              => 'primary',
                      'theme_location'    => 'primary',
                      'depth'             => 2,
                      'menu_class'        => 'nav navbar-nav',
                      'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
                      'walker'            => new wp_bootstrap_navwalker())
                      );
                      ?>

In Functions.php

// Register Custom Navigation Walker
require_once('wp_bootstrap_navwalker.php');
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'themename' ),
) );

Any help or pointers would be appreciated

share|improve this question
2  
A few things: 1) remove the 'menu' parameter from your wp_nav_menu() call. Only use 'theme_location'. 2) What is your "category page"? The category archive index (category.php) or a custom page template? Or something else? 3) Can we see a live link that demonstrates the issue? –  Chip Bennett Apr 25 at 15:16
    
You need to show your walker code. –  vancoder Apr 25 at 17:23
    
Check CSS to see if there are some required elements to display menu. The "collapse" in menu ID is suspect. –  unifiedac Apr 25 at 19:01
    
Ive taken the site out of maintenance mode, reallybadmovies.co.uk so, if you click on any of the menu items bar the sample page (just to demo works ok on others). the main nav not appearing. I think the CSS is ok, as a look at the HTML shows me that the menu items arent actually being generated. My category page is category.php, and isnt a custom one Regarding the walker nav, its just using the settings as per github.com/twittem/wp-bootstrap-navwalker I removed the main menu reference as suggested, and problem still persists unfortunately –  Pilgrimiv Apr 26 at 14:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.