Title: Previous/next post link doesn&#8217;t work with query posts?
Last modified: August 19, 2016

---

# Previous/next post link doesn’t work with query posts?

 *  Resolved [virgild](https://wordpress.org/support/users/virgild/)
 * (@virgild)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/previousnext-post-link-doesnt-work-with-query-posts/)
 * Hello all 🙂
 * I stumbled over another problem. In my index page, I’m using query posts to retrieve
   posts from a category and the previous/next_posts_link function doesn’t work.
   When I click to navigate to older posts it just re-loads the current posts. It
   works in archives and any loop without query.
 * Has anyone else had this issue?

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/previousnext-post-link-doesnt-work-with-query-posts/#post-1415692)
 * Example of proper pagination:
 *     ```
       <?php
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       query_posts('cat=1&posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);
       ?>
       ```
   
 *  Thread Starter [virgild](https://wordpress.org/support/users/virgild/)
 * (@virgild)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/previousnext-post-link-doesnt-work-with-query-posts/#post-1415718)
 * ooh! that works! Thanks, I’ll keep that in mind 🙂

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

The topic ‘Previous/next post link doesn’t work with query posts?’ is closed to 
new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [virgild](https://wordpress.org/support/users/virgild/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/previousnext-post-link-doesnt-work-with-query-posts/#post-1415718)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
