Title: Post coding help required
Last modified: August 19, 2016

---

# Post coding help required

 *  [iperez_genius](https://wordpress.org/support/users/iperez_genius/)
 * (@iperez_genius)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/post-coding-help-required/)
 * Can someone help with the following.
 * I need to pull posts in three ways but collectively as one. this is what i mean
 * The 15 most recent posts
    I need code to get 1. the most recent posts (1) 2. 
   the most recent posts with feature images that is not in 1. (3) 3. the next most
   recent post (4)
 * so if i had 10 posts 1 being most recent
    1. 2. 3.with image 4. 5.With image 
   6.With Image 7. 8.With Image 9. 10.
 * The results returned for each point would be
    1. post 1 2. post 3 post 5 and 
   post 6 3. post 2, post 4, post 7 and post 9
 * Can anyone advise on how to achieve this
 * thanks in advance
    Ilan

Viewing 1 replies (of 1 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/post-coding-help-required/#post-1791608)
 * You can reuse the query by using rewind_posts().
 * Create 3 while loops, one for each type of post. Test for the type of post inside
   each loop.
 * Use a counter to exit the loops when the correct number of posts is found.
 * Save the IDs of the used posts in an array and do not display if a duplicate.
 * rewind_posts() after each loop.

Viewing 1 replies (of 1 total)

The topic ‘Post coding help required’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/post-coding-help-required/#post-1791608)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
