exclude sidebar queries
-
i have this code in function.php
function add_my_CPT( $query ) { if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { $query->set( 'post_type', array('post', 'nav_menu_item', 'stories')); return $query; } }it add post types to the archive pages.
but in archive pages i have sidebar with custom queries
$args2 = array('posts_per_page' => 3, 'post_type' => 'tips');
so in archive pages the sidebar queries shows all the posts (stories and tips) instead noly tips.how can i disable this?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘exclude sidebar queries’ is closed to new replies.