Title: Excluding categories from $wp_query using Starks framework
Last modified: August 19, 2016

---

# Excluding categories from $wp_query using Starks framework

 *  [BenMoseley](https://wordpress.org/support/users/benmoseley/)
 * (@benmoseley)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/excluding-categories-from-wp_query-using-starks-framework/)
 * Title says it all.
 * Here’s the query used:
 *     ```
       <?php if ( $wp_query->max_num_pages > 1 ) : ?>
       		<?php next_posts_link( __( '&larr; Older posts', 'twentyten' ) ); ?>
       		<?php previous_posts_link( __( 'Newer posts &rarr;', 'twentyten' ) ); ?>
       <?php endif; ?>
       ```
   
 * I’ve tried this:
 *     ```
       <?php
       $args=array(
       	'category__not_in' => array('9', '10', '12', '13')
       );
       $the_query = new WP_Query($args);
       ?>
       <?php if ( $the_query->max_num_pages > 1 ) : ?>
       		<?php next_posts_link( __( '&larr; Older posts', 'twentyten' ) ); ?>
       		<?php previous_posts_link( __( 'Newer posts &rarr;', 'twentyten' ) ); ?>
       <?php endif; ?>
       ```
   
 * No dice. Anyone dealt with this before?

The topic ‘Excluding categories from $wp_query using Starks framework’ is closed
to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [BenMoseley](https://wordpress.org/support/users/benmoseley/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/excluding-categories-from-wp_query-using-starks-framework/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
