WordPress.org

Ready to get started?Download WordPress

Forums

Excluding post categories from my gallery... (1 post)

  1. jma666
    Member
    Posted 2 years ago #

    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?
    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic