Title: Pagination doesn&#039;t work on single.php
Last modified: August 22, 2016

---

# Pagination doesn't work on single.php

 *  [ryuzaki21](https://wordpress.org/support/users/ryuzaki21/)
 * (@ryuzaki21)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/pagination-doesnt-work-on-singlephp/)
 * Hi, I’m new on wordpress theme development.
    I’m trying to add pagination on 
   single.php by adding this code.
 *     ```
       <div class="nav-previous alignleft"><?php next_posts_link( 'Older posts' ); ?></div>
       <div class="nav-next alignright"><?php previous_posts_link( 'Newer posts' ); ?></div>
       ```
   
 * But it’s not showing.
 * my single.php is like this:
 *  `<div id=”content”>
    <?php if ( have_posts() ) while ( have_posts() ) : the_post();?
   >
 *  <article>
 *  <h2><?php the_title(); ?></h2>
    <p class=”small”><time datetime=”<?php the_time(‘
   Y-m-d’ ); ?>” pubdate><?php the_date(); ?></time> – Written by <a href=”<?php
   get_the_author_link(); ?> “><?php the_author(); ?></a> – <?php comments_popup_link(‘
   Leave a Comment’, ‘1 Comment’, ‘% Comments’); ?></p> <?php the_content(); ?> 
   <p class=”small”>Category: <?php the_category(‘, ‘) ?> &nbsp&nbsp&nbsp <?php 
   the_tags() ?></p> <?php if ( get_the_author_meta( ‘description’ ) ) : ?> <?php
   echo get_avatar( get_the_author_meta( ‘user_email’ ) ); ?> <h3>About <?php echo
   get_the_author() ; ?></h3> <?php the_author_meta( ‘description’ ); ?> <?php endif;?
   >
 *  <?php comments_template( ”, true ); ?>
 *  </article>
    <?php endwhile; ?> </div>`
 * I try to put the code everywhere but it isn’t work.
    Anyone can help?

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

 *  Thread Starter [ryuzaki21](https://wordpress.org/support/users/ryuzaki21/)
 * (@ryuzaki21)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/pagination-doesnt-work-on-singlephp/#post-5458715)
 * Anyone can help me?
 *  Thread Starter [ryuzaki21](https://wordpress.org/support/users/ryuzaki21/)
 * (@ryuzaki21)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/pagination-doesnt-work-on-singlephp/#post-5458736)
 * Hellooooooo…
 *  [CMSHelpLive](https://wordpress.org/support/users/cmshelplivecom/)
 * (@cmshelplivecom)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/pagination-doesnt-work-on-singlephp/#post-5458737)
 * Hi,
    You can use Wp-Paginate plugin for this.
 *  Thread Starter [ryuzaki21](https://wordpress.org/support/users/ryuzaki21/)
 * (@ryuzaki21)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/pagination-doesnt-work-on-singlephp/#post-5458738)
 * [@cmshelplive](https://wordpress.org/support/users/cmshelplive/) thanks for reply.
   I need it within the theme. not with plugin.
 *  Thread Starter [ryuzaki21](https://wordpress.org/support/users/ryuzaki21/)
 * (@ryuzaki21)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/pagination-doesnt-work-on-singlephp/#post-5458954)
 * anyone can help?

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

The topic ‘Pagination doesn't work on single.php’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [ryuzaki21](https://wordpress.org/support/users/ryuzaki21/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/pagination-doesnt-work-on-singlephp/#post-5458954)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
