Title: 2 parameters for query_posts
Last modified: August 19, 2016

---

# 2 parameters for query_posts

 *  Resolved [Sandra](https://wordpress.org/support/users/sandracwalsh/)
 * (@sandracwalsh)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/2-parameters-for-query_posts/)
 * Hello –
 * I would like to limit the posts in my header section by 2 parameters – category
   and number of posts shown.
 * <?php query_posts(‘cat=1’);?>
 * <?php query_posts(‘showposts=1’);?>
 * Is there a way to combine these?
 * Many thanks
    sandra

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

 *  [asechrest](https://wordpress.org/support/users/asechrest/)
 * (@asechrest)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/2-parameters-for-query_posts/#post-1024244)
 * I think it would be:
 * `query_posts('cat=1&showposts=1');`
 *  Thread Starter [Sandra](https://wordpress.org/support/users/sandracwalsh/)
 * (@sandracwalsh)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/2-parameters-for-query_posts/#post-1024246)
 * Perfect!
 * Sorry I am such a nube. Thank you so much 🙂

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

The topic ‘2 parameters for query_posts’ is closed to new replies.

## Tags

 * [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: [Sandra](https://wordpress.org/support/users/sandracwalsh/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/2-parameters-for-query_posts/#post-1024246)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
