Title: query_posts questions?
Last modified: August 19, 2016

---

# query_posts questions?

 *  [dew215](https://wordpress.org/support/users/dew215/)
 * (@dew215)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/query_posts-questions/)
 * I am trying to populate a section on my websites home page, that grabs posts 
   that are part of two categories.
 * To be more specific, i want to only show a post on the home page, if it is part
   of Category 3 AND 7, not 3 OR 7. Which appears to be what is happening. Here 
   is the code I am using:
 * query_posts(“cat=5&cat=3&showposts=1”);
 * The way I thought this would work is it would look and see if it is in cat 5,
   and then if it is also in cat 3 as well. Any help here?

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/query_posts-questions/#post-1778366)
 * have you tried reading the docu:
    [http://codex.wordpress.org/Function_Reference/query_posts#Category_Parameters](http://codex.wordpress.org/Function_Reference/query_posts#Category_Parameters)
 * `category__and` parameter

Viewing 1 replies (of 1 total)

The topic ‘query_posts questions?’ 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/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/query_posts-questions/#post-1778366)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
