WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Post Type Archives (menu disppear) (2 posts)

  1. scottcarlton
    Member
    Posted 1 year ago #

    I'am using Custom Post Type Archive and it causes my wp_nav to disappear. I found this WP Nav Menu Dissapears in Category Pages but didn't seem to work. And I used is to add custom post to query

    add_filter('pre_get_posts', 'query_post_type');
    function query_post_type($query) {
      if(is_category() || is_tag()) {
        $post_type = get_query_var('post_type');
    	if($post_type)
    	    $post_type = $post_type;
    	else
    	    $post_type = array('post','press','nav_menu_item');
        $query->set('post_type',$post_type);
    	return $query;
        }

    I am pretty frustrated here. Please help! Thanks

  2. scottcarlton
    Member
    Posted 1 year ago #

    SOLVED! Just removed the above code from function.php

Topic Closed

This topic has been closed to new replies.

About this Topic