Title: Pagination Recentposts.php
Last modified: August 22, 2016

---

# Pagination Recentposts.php

 *  [united9](https://wordpress.org/support/users/united9/)
 * (@united9)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/pagination-recentpostsphp/)
 * Merry Christmas to All!
 * I want an little guidance in creation of recentposts.php page.
 * I have created a new page in wordpress to display all recent posts at one place
   without widget.
    Below is the code I have in my recentposts.php , I had successfully
   displayed all posts on that page and now I want previous and next function after
   every 10 posts.
 * Here is the code I have
    //___Code Start____
    - <?php
    -  $args = array( ‘numberposts’ => ’10’ );
       $recent_posts = wp_get_recent_posts(
      $args ); foreach( $recent_posts as $recent ){ echo ‘
    - 
    -  ‘;
       } ?>
 * //__Code End________
 * Please let me know what code I should add for previous and next button after 
   every 10 posts. I have more than 50 blog posts.
 * Thanks in Advance.
    Nikhil

The topic ‘Pagination Recentposts.php’ is closed to new replies.

## Tags

 * [pagination](https://wordpress.org/support/topic-tag/pagination/)
 * [php code](https://wordpress.org/support/topic-tag/php-code/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [united9](https://wordpress.org/support/users/united9/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/pagination-recentpostsphp/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
