Title: query_posts() and $query_string problem
Last modified: August 19, 2016

---

# query_posts() and $query_string problem

 *  [kriesiat](https://wordpress.org/support/users/kriesiat/)
 * (@kriesiat)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-query_string-problem/)
 * Hello everybody, I got a question concerning the $query_string variable.
 * What I want to do is: i want to exclude one category from all of my archive pages.
   According to the [Codex](http://codex.wordpress.org/Template_Tags/query_posts#Usage)
   I just have to make a function call like this in my archive.php:
 * `query_posts($query_string . &cat=-3);`
 * This works to some degree: category 3 is excluded but the loop now always shows
   the same entries, no matter which category I am browsing to. I guess this is 
   because $query_string is always empty (tested it with an echo statement on several
   pages/posts).
 * Do I need to call a global first to make this work? Or is this not supposed to
   work that way? Would be glad if you could help me. Thanks

The topic ‘query_posts() and $query_string problem’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [kriesiat](https://wordpress.org/support/users/kriesiat/)
 * Last activity: [17 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-query_string-problem/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
