Title: displaying excluded posts with query_posts
Last modified: August 19, 2016

---

# displaying excluded posts with query_posts

 *  [Loren](https://wordpress.org/support/users/nbseminary/)
 * (@nbseminary)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/displaying-excluded-posts-with-query_posts/)
 * On my home page I am using
    `query_posts('cat=-114,-115,-116,-117,-119&showposts
   =1');` to exclude posts from those categories. However I would like to be able
   to show a post from an excluded category if it is also in a category that is 
   not excluded. I.e. if the post is in both category 2 and 114 I would like it 
   to display on the home page. I had hoped that WordPress would do this by default
   but that does not seem to be the case. In the codex on query_posts there is description
   of how to use an array with “category__in”, i.e.: `query_posts(array("category__in'
   => array(2,6)))` but I cannot figure out how to combine that with the multiple
   exclusions above. Is there a way to do this?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [shane-g](https://wordpress.org/support/users/shane-g/)
 * (@shane-g)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/displaying-excluded-posts-with-query_posts/#post-1217411)
 * Hi,
 * Refer this article:
 * [http://codex.wordpress.org/The_Loop#Exclude_Posts_From_Some_Category](http://codex.wordpress.org/The_Loop#Exclude_Posts_From_Some_Category)
 * Thanks,
 * Shane G.
 *  Thread Starter [Loren](https://wordpress.org/support/users/nbseminary/)
 * (@nbseminary)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/displaying-excluded-posts-with-query_posts/#post-1217646)
 * Hi Shane,
    Thanks for the response. The link you included doesn’t particularly
   address my dilemma. Using query_posts I am already excluding categories from 
   my home page (cat=-3) but am trying to figure out how to “re-include” posts that
   are in the excluded category. I was trying to do that by adding a non-excluded
   category to the post but that does not seem to work. Maybe it would help to describe
   how my application of this works. I have multiple authors and one author wants
   all of his posts to appear in a particular template page (say cat=3 template)
   and not to appear on the home page – this works fine. But he wants the liberty
   to allow certain specific posts to appear in both his template as well as on 
   the home page. It is with the re-including of such a post that I am having difficulty.
   Any suggestions? Loren

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘displaying excluded posts with query_posts’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [exclude](https://wordpress.org/support/topic-tag/exclude/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Loren](https://wordpress.org/support/users/nbseminary/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/displaying-excluded-posts-with-query_posts/#post-1217646)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
