direct custom post query interferes with other queries on page
You might be looking for wp_reset_query You would insert this after your return. add_filter(‘pre_get_posts’, ‘query_post_type’); function query_post_type($query) { if($query->is_category() || $query->is_tag() || $query->is_home() && $query->is_main_query()) { $post_type = get_query_var(‘post_type’); if($post_type) $post_type = $post_type; else $post_type = array(‘post’,’my_custom_post_type’); $query->set(‘post_type’,$post_type); return $query; } wp_reset_query; } I really hope this helps.