Excluding post categories from my gallery…
I am trying to specify some categories to exclude from a gallery listing different types of post.
Here is the code I have.
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts( array( 'category__not_in' => array( 144, 145 ), 'post_type' => 'gallery', 'posts_per_page' => -1, 'ignore_sticky_posts' => 1, 'orderby' => $gogo_gallery_items_order ) ); $postcount = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); $postcount++;?>
I added this line:
'category__not_in' => array( 144, 145 ),
but it doesn’t seem to filter the categories I don’t want.
Anybody know what would be the correct solution?
- The topic ‘Excluding post categories from my gallery…’ is closed to new replies.