• Resolved Jeckstart

    (@jeckstart)


    Hi, I have same problem that was already posted and solved, but little different conditions. That guys used custom post types or queue filters which caused the problem, I dont use such and still have the same:
    I call wp_nav_menu from header and sidebar, and it works everywhere except category page.
    None of their solutions work for me.
    So i’m trying to get nav_menu_items manually

    $items = get_objects_in_term( 28, 'nav_menu' );
    $itposts = array();
    foreach ($items as $it) {
    	$temppost = get_post( $it );
    	$itposts[] = $temppost->ID;
    }
    $args = array('post_type' => 'nav_menu_item');
    $args['post__in'] = $itposts;
    
    echo '<br />__WP_Query__<br />';
    $the_query = new WP_Query( $args );
    if ( $the_query->have_posts() ) {
    	echo '<ul>';
    	while ( $the_query->have_posts() ) {
    		$the_query->the_post();
    		echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
    	}
    	echo '</ul>';

    ..And I get same result then – in category page WP_Query is empty when in other pages it works

    Maybe anyone had this and can share solution?

    WP Nav Menu Dissapears in Category Pages! [1]
    another closed topic

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘WP Nav Menu Dissapears in Category Pages! [2]’ is closed to new replies.