Pagination on single.php
-
I’m trying to implement pagination on a website I did not code(thus the old WP version).
The following code lists 5 posts like asked but when clicking the navigation it will just change the URL to https://mysite.com?p=1516&paged=2 the content won’t change to list the next 5 posts.
Code in single.php
<?php query_posts('posts_per_page=5'); if (have_posts()) : while (have_posts()) : the_post(); ?> <li><a>"><?php the_title(); ?></a> <div class="date">{<?php the_time('l, j F, Y') ?>}</div></li> <?php endwhile; previous_posts_link(); ?> ? <?php next_posts_link(); endif; ?>
Can anyone point out what is wrong with the code and how to solve the issue?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Pagination on single.php’ is closed to new replies.