• I’d like to add the standard navigation menu to my child theme of Twenty Twelve.

    In header.php I have (not modified from parent):
    <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>

    This leaves my archive pages without main navigation, see here:
    https://www.usabilityblog.de/kategorie/web-usability/interfacedesign

    When I use
    <?php wp_nav_menu( ); ?>
    I get the navigation, but it shows the second level of pages, which I don’t want. I just want the same menu on all my archive pages like I have on all other pages.

    Any hints?

Viewing 1 replies (of 1 total)
  • Thread Starter benutzerfreund

    (@benutzerfreund)

    OK, found the problem: In functions.php I have

    function my_get_posts( $query ) {
    	$var = false;
    	if (isset($query->query_vars['suppress_filters'])){
    	     $var = $query->query_vars['suppress_filters'];
    	}
    	if (( is_home() && false ==$var ) || is_feed()  ) {
    	     $query->set( 'post_type', array( 'post', 'my_books') );
    	}
    	return $query;
    }
    add_filter( 'pre_get_posts', 'my_get_posts' );

    This is to show book reviews (custom post type) on the front page.

    But when I add “|| is_category() || is_tag()”, the menu disappears on these pages.

    Any idea why this happens? And what to do about it?

Viewing 1 replies (of 1 total)
  • The topic ‘Navigation on archive pages’ is closed to new replies.