Title: Custom Multiple Query_posts ID&#039;s
Last modified: August 20, 2016

---

# Custom Multiple Query_posts ID's

 *  [rockaj](https://wordpress.org/support/users/rockaj/)
 * (@rockaj)
 * [15 years ago](https://wordpress.org/support/topic/custom-multiple-query_posts-ids/)
 * Hello, I want to display specific posts that I choose by id. I went to that link
   like many times,and I suck [LINK](http://codex.wordpress.org/Function_Reference/query_posts)
   
   I can’t figure out how to get multiple post ID’s to show up on the custom query
   page.
 * **Below the code is working allowing me to post one postID#1033**
 *     ```
       <?php
       query_posts('p=1033');
       while (have_posts()) : the_post();
       endwhile;
       ?>
       ```
   
 * **but i want to post more than 1, multiple postIDs so i tried the code below 
   but not working**
 *     ```
       <?php
       query_posts('p=1033,232,143,110,12');
       while (have_posts()) : the_post();
       endwhile;
       ?>
       ```
   
 * please help thank you..

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years ago](https://wordpress.org/support/topic/custom-multiple-query_posts-ids/#post-2106845)
 * [http://codex.wordpress.org/Class_Reference/WP_Query#Post_.26_Page_Parameters](http://codex.wordpress.org/Class_Reference/WP_Query#Post_.26_Page_Parameters)
 * try:
 *     ```
       query_posts( array('post__in' => array(1033,232,143,110,12)) );
       ```
   
 * (the posts will be sorted by date descending, if you don’t specifiy anything 
   else)
 * if you need the posts to show in your given order, you could try:
 *     ```
       <?php
       $post_list = array(1033,232,143,110,12);
       foreach( $post_list as $post_id ) :
       query_posts('p='.$post_id);
       while (have_posts()) : the_post();
       endwhile;
       wp_reset_query();
       endforeach;
       ?>
       ```
   
 * (untested)
 *  Thread Starter [rockaj](https://wordpress.org/support/users/rockaj/)
 * (@rockaj)
 * [15 years ago](https://wordpress.org/support/topic/custom-multiple-query_posts-ids/#post-2106856)
 * hello,thanks for your reply! ALCHYMYTH your a LEGEND! cheers 🙂

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

The topic ‘Custom Multiple Query_posts ID's’ is closed to new replies.

## Tags

 * [custom-query](https://wordpress.org/support/topic-tag/custom-query/)
 * [multiple post](https://wordpress.org/support/topic-tag/multiple-post/)
 * [query_post](https://wordpress.org/support/topic-tag/query_post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [rockaj](https://wordpress.org/support/users/rockaj/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/custom-multiple-query_posts-ids/#post-2106856)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
