Title: Paged Post
Last modified: August 19, 2016

---

# Paged Post

 *  Resolved [MaddTechWF](https://wordpress.org/support/users/maddtechwf/)
 * (@maddtechwf)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/paged-post/)
 * How would I go about creating a page that shows the last 5 posts and then has
   a next/previous buttons?

Viewing 1 replies (of 1 total)

 *  [kz](https://wordpress.org/support/users/kz/)
 * (@kz)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/paged-post/#post-1367362)
 *     ```
       <?php
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       query_posts('page_per_posts=5&paged=' . $paged);
         if(have_posts()) :
           while(have_posts()) :
             the_post();
             ?>
             <a href="<? the_permalink(); ?>"><?php the_title() ?></a>
             <div class="entry"><?php the_content(); ?></div>
             <?php
           endwhile;
           ?>
           <div class="navigation">
             <div class="alignleft"><?php previous_posts_link('&laquo; Newer') ?></div>
             <div class="alignright"><?php next_posts_link('Older &raquo;') ?></div>
           </div>
           <?php
         endif;
       wp_reset_query();
       ?>
       ```
   

Viewing 1 replies (of 1 total)

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

 * 1 reply
 * 2 participants
 * Last reply from: [kz](https://wordpress.org/support/users/kz/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/paged-post/#post-1367362)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
