Title: Recent Post
Last modified: August 21, 2016

---

# Recent Post

 *  [Jaswinder0091](https://wordpress.org/support/users/jaswinder0091/)
 * (@jaswinder0091)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/recent-post-7/)
 * Hi
    I want to show 12 latest post on a page , but 1-5 in 1st div and 6-12 in 
   2nd div. When i **add** new post, the **last post from 1st div** should **shift**
   to **2nd div** and the **last post in 2nd div moves out.**
 * Coding is preferable..
 * Is it possible ??
 * Thanks

Viewing 1 replies (of 1 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/recent-post-7/#post-4755270)
 * In general, use the code structure below to group posts in divs:
 *     ```
       $posts_per_row = 6;
       $counter = 0;
       while ($counter < 10) {  // Use your own while condition
          if (++$counter % $posts_per_row == 1) {
             echo "start new row div<br />";
          }
          echo "content for $counter<br />";
          if ($counter % $posts_per_row == 0) {
             echo "end row div<br />";
          }
       }
       if ($counter % $posts_per_row != 0) {
             echo "end row div<br />";
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Recent Post’ is closed to new replies.

## Tags

 * ["recent post"](https://wordpress.org/support/topic-tag/recent-post/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * 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: [12 years, 2 months ago](https://wordpress.org/support/topic/recent-post-7/#post-4755270)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
