Title: query_post array
Last modified: August 19, 2016

---

# query_post array

 *  [stephanM](https://wordpress.org/support/users/stephanm/)
 * (@stephanm)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/query_post-array/)
 * it’s maybe easy for php aces :
 * i have 4 categories : “band1″(id=2) “biography”(id=3) “records”(id=4) “news”(
   id=5)
 * i would like to create a template category page for band1 so i call it “category-
   2.php”
 * In it i would like a biography, the records they have made, and the last news
   about them.
 * So after a quick search in the codex, my choice is for the query_post method.
 * I try to display the “records” released by “band1”, it works fine with <? query_posts(
   array(‘category__and’ => array(2,4)));
    ?> but now i would like to add the “bio”
   of the band1 and the “last news”. So i write after the first query post array,
   a second one like this : <? query_posts(array(‘category__and’ => array(2,3)));?
   > this second query_post array reset my previous one (wich was displaying the
   records).
 * So i think i have a php array syntax problem and i’m sure that i can display 
   what i want in a single line of query_post(array) !
 * Now i’m looking for the good pal to help me 🙂
 * thanx for your help !

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/query_post-array/#post-1049193)
 * Consider using the [template tag](http://codex.wordpress.org/Template_Tags), 
   [get_posts()](http://codex.wordpress.org/Template_Tags/get_posts), instead of`
   query_posts`. It accepts the same parameters listed in the [query_posts()](http://codex.wordpress.org/Template_Tags/query_posts)
   article.
 *  Thread Starter [stephanM](https://wordpress.org/support/users/stephanm/)
 * (@stephanm)
 * [17 years ago](https://wordpress.org/support/topic/query_post-array/#post-1049297)
 * thanks for your help ! i will try it !

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

The topic ‘query_post array’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [stephanM](https://wordpress.org/support/users/stephanm/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/query_post-array/#post-1049297)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
