• tried to follow this post: http://wordpress.org/support/topic/exclude-posts-from-wp_query

    but no luck, doesn’t seem to exclude the categories in that category. any ideas?

    here is the code:

    <?php
                /*start lukasz edit to exclude cats */
                $args=array(
    			  'category__not_in' => array(125),
    			);
    			$query = null;
    			/* end lukasz edits */ 
    
    			$query = new WP_Query($args); /* lukasz: added $args in query, take out of errors*/
    			$query->query('posts_per_page='. $number );
    			while ($query->have_posts()) : $query->the_post();
    			?>
  • The topic ‘exclude categories not working’ is closed to new replies.