The menus that don’t work have blank space between the <div> tags with class “collapse navbar-collapse navbar-primary-collapse” vs menus that do with with the list of the menu.
]]>category/
pages but not tag/
pages.
I’m not sure how you write the template for category page. Did you render the menu in there and how?
]]>Do you have something like is_category() in the archive.php, header.php?
Please make sure that you did not conditional anything before render the menu.
<?php wp_nav_menu(array('theme_location' => 'primary', 'container' => false, 'menu_class' => 'nav navbar-nav')); ?>
code doesn’t show up.
The only conditional in the archive page is for the title above the posts.
]]>I use this BootstrapBasic for demo site and use it as parent theme for real site and both works fine. So, I can say that the theme itself should works fine in your case.
May I ask you to try something more?
I suggest to do it in your localhost to prevent any damage to real website.
Please try to disable all the plugins fist and see is it works?
If it still not works then try to comment all the code (php comment /*...code here...*/
) in your theme that contain any hooks into WordPress such as add_filter()
, add_action()
and see is it works? ??
function add_custom_types_to_tax( $query ) {
if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
$query->set( 'post_type', array('post', 'photo-essay') );
}
}
add_filter( 'pre_get_posts', 'add_custom_types_to_tax' );
Menu works fine when I comment it out. Any suggestions how I can get multiple post types to still show up on category and taxonomy pages without this code? Or is there an error in it we can fix?
]]>function namespace_add_custom_types( $query ) {
if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
$query->set( 'post_type', array(
'post', 'nav_menu_item', 'your-custom-post-type-here'
));
return $query;
}
}
add_filter( 'pre_get_posts', 'namespace_add_custom_types' );
]]>