Title: &quot;Next/Previous posts&quot; does not work. Help!
Last modified: August 19, 2016

---

# "Next/Previous posts" does not work. Help!

 *  Resolved [Lars Daniel](https://wordpress.org/support/users/lars-daniel/)
 * (@lars-daniel)
 * [15 years ago](https://wordpress.org/support/topic/nextprevious-posts-does-not-work-help/)
 * This is the site I am working on: [http://www.blog.halfdane.dk](http://www.blog.halfdane.dk)
   
   I have set the number of posts on the frontpage to be 5. The link “Older” should
   take you to the older posts, but it just loads the first 5 again. Help is highly
   appreciated.
 * Thanks!

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

 *  Thread Starter [Lars Daniel](https://wordpress.org/support/users/lars-daniel/)
 * (@lars-daniel)
 * [15 years ago](https://wordpress.org/support/topic/nextprevious-posts-does-not-work-help/#post-1999933)
 * Ok, I have found out that a line in index.php that makes the frontpage only show
   a certain category, is creating the problem:
    <?php query_posts(‘cat=18&showposts
   =’.get_option(‘posts_per_page’)); ?>
 * I don´t know how to solve it though. Anyone?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years ago](https://wordpress.org/support/topic/nextprevious-posts-does-not-work-help/#post-1999938)
 * try:
 * `<?php query_posts('cat=18&showposts='.get_option('posts_per_page').'paged='.
   get_query_var('paged')); ?>`
 * [http://codex.wordpress.org/Function_Reference/WP_Query#Pagination_Parameters](http://codex.wordpress.org/Function_Reference/WP_Query#Pagination_Parameters)
 *  Thread Starter [Lars Daniel](https://wordpress.org/support/users/lars-daniel/)
 * (@lars-daniel)
 * [15 years ago](https://wordpress.org/support/topic/nextprevious-posts-does-not-work-help/#post-1999969)
 * Thanks!
    Unfortunately that did not change anthing 🙁 Other ideas?
 *  Thread Starter [Lars Daniel](https://wordpress.org/support/users/lars-daniel/)
 * (@lars-daniel)
 * [15 years ago](https://wordpress.org/support/topic/nextprevious-posts-does-not-work-help/#post-1999973)
 * If it helps to see what is going on, here is my index.php:
    (If I remove the 
   line in bold, the problem disappears, but so does my selection of category.)
 * _[[code moderated ](http://codex.wordpress.org/Forum_Welcome)– please use the
   [pastebin](http://pastebin.com/)]_
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years ago](https://wordpress.org/support/topic/nextprevious-posts-does-not-work-help/#post-1999974)
 * my bad – forgot the ampersand `&` before the `'paged='`;
 *     ```
       <?php query_posts('cat=18&showposts='.get_option('posts_per_page').'&paged='.get_query_var('paged')); ?>
       ```
   
 * hopefully, this gets it to work …
 *  Thread Starter [Lars Daniel](https://wordpress.org/support/users/lars-daniel/)
 * (@lars-daniel)
 * [15 years ago](https://wordpress.org/support/topic/nextprevious-posts-does-not-work-help/#post-1999976)
 * Yihah! You did it!
    Thanks a bunch!

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

The topic ‘"Next/Previous posts" does not work. Help!’ is closed to new replies.

## Tags

 * [next](https://wordpress.org/support/topic-tag/next/)
 * [previous](https://wordpress.org/support/topic-tag/previous/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Lars Daniel](https://wordpress.org/support/users/lars-daniel/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/nextprevious-posts-does-not-work-help/#post-1999976)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
