Title: Having troubles using query_posts
Last modified: August 20, 2016

---

# Having troubles using query_posts

 *  [cachip](https://wordpress.org/support/users/cachip/)
 * (@cachip)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/having-troubles-using-query_posts/)
 * Hi,
 * I’ve been trying to exclude a category from my home page for two days, but I 
   keep having the same problem.
 * The order of the posts is reversed when I implement the following code :
    <?php
   query_posts(“$query_string&cat=-412”), 412 being the ID of the category.
 * Did one of you encoutered the same problem ? I unfortunately can’t give you the
   link to the wordpress, it’s a private blog for my company.
 * Here is the full code for the index page :
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * Thanks,
    Cachip

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/having-troubles-using-query_posts/#post-2518281)
 * Try `<?php query_posts($query_string . '&cat=-412')`.
 *  Thread Starter [cachip](https://wordpress.org/support/users/cachip/)
 * (@cachip)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/having-troubles-using-query_posts/#post-2518536)
 * Hello,
 * I’ve got the same problem using that line of code : <?php query_posts($query_string.‘&
   cat=-412’); ?>
 * I can’t find a solution. Even the plugins dedicated to it create this issue. 
   If it can help you, here’s the code of my home page :
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_

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

The topic ‘Having troubles using query_posts’ is closed to new replies.

## Tags

 * [exclude categories](https://wordpress.org/support/topic-tag/exclude-categories/)
 * [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: [cachip](https://wordpress.org/support/users/cachip/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/having-troubles-using-query_posts/#post-2518536)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
