Title: Query posts by certain IDs
Last modified: August 19, 2016

---

# Query posts by certain IDs

 *  [levani01](https://wordpress.org/support/users/levani01/)
 * (@levani01)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/query-posts-by-certain-ids/)
 * How can I display posts that have certain IDs? For example I need to display 
   posts with an ID 1, 2, 3, 4, 5, and 6 in my page template. Is it possible?

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

 *  [Rhand](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/query-posts-by-certain-ids/#post-1164416)
 * I Googled a bit as I never did this and you should use something like
 *     ```
       query_posts(array('post__in' => array(5,12,2,14,7));
       ```
   
 * But this code needs some fixing…
 *  Thread Starter [levani01](https://wordpress.org/support/users/levani01/)
 * (@levani01)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/query-posts-by-certain-ids/#post-1164417)
 * I have also found that code but it really needs some fixing. One of the big problem
   is pagination that I can’t make working despite several hours trying. Any ideas?

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

The topic ‘Query posts by certain IDs’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [levani01](https://wordpress.org/support/users/levani01/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/query-posts-by-certain-ids/#post-1164417)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
