Title: Multiple query_posts
Last modified: August 19, 2016

---

# Multiple query_posts

 *  Resolved [fruitattack](https://wordpress.org/support/users/fruitattack/)
 * (@fruitattack)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/multiple-query_posts/)
 * I have a theme where I’m listing the latest posts of a specific category in the
   header. But the problem I’ve run into is that when I use query_posts(‘showposts
   =1&cat=3’), the main Loop is also affected, and will only show one post of that
   category.
 * Also affected are pages and categories which will show whatever query_posts got
   previously.
 * Is there a workaround for this?
 * What I’m essentially trying to do is post the latest post from a specific category,
   and the code for that comes before the main Loop which is supposed to list the
   latest posts overall. By using query_posts before the Main loop, it causes the
   main loop to also display what query posts called up.
 * I’ve tried query_posts(‘showposts=10’) to no avail. It works fine for the home
   page, but when it comes to individual pages and categories, the posts it displays
   are the same.

Viewing 1 replies (of 1 total)

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [18 years, 4 months ago](https://wordpress.org/support/topic/multiple-query_posts/#post-689209)
 * After you are finished with your extra query_posts, use this to reset it back
   to the defaults for whatever you’re supposed to be looking at:
    `wp_reset_query();`

Viewing 1 replies (of 1 total)

The topic ‘Multiple query_posts’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [18 years, 4 months ago](https://wordpress.org/support/topic/multiple-query_posts/#post-689209)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
