Title: posts_nav_link() and query_posts() problem
Last modified: August 19, 2016

---

# posts_nav_link() and query_posts() problem

 *  [jakesee](https://wordpress.org/support/users/jakesee/)
 * (@jakesee)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/posts_nav_link-and-query_posts-problem/)
 * hi all,
 * Hope someone can help. Thanks a lot.
 * There is a previous discussion here [http://wordpress.org/support/topic/57912?replies=9](http://wordpress.org/support/topic/57912?replies=9)
   but it’s talking about category and it seems like it doesn’t work for my showposts
   on home page.
 *     ```
       <?php
       // this code is in header.php
       if (is_home()) {
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       query_posts("showposts=1&paged=$paged");
       }
       ?>
       ```
   
 * posts_nav_link() generates an “older post” on home page to link to page 2, but
   nothing is when: There are 4 posts in total,and settings in admin>settings>reading
   >at most 5 blog posts.
 * if admin>settings>reading>at most 2 blog posts. page 2 shows 1 post (instead 
   of 2 posts) and the post is the second next oldest post. posts_nav_link() generates
   an “older post” link to page 3, but page 3 is blank.

Viewing 1 replies (of 1 total)

 *  [Durgé Seerden](https://wordpress.org/support/users/dsdeur/)
 * (@dsdeur)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/posts_nav_link-and-query_posts-problem/#post-1179710)
 * If I may ask, why do you use `query_posts()` instead of [the loop](http://codex.wordpress.org/The_Loop_in_Action)?
 * I think if you would just use [the loop](http://codex.wordpress.org/The_Loop_in_Action),
   you could copy paste it from the default theme you’re not into coding and modify
   it so it will work in you theme, the problems will be solved.
 * Greetz,
 * Durgé
    [Dimics.com](http://dimics.com)

Viewing 1 replies (of 1 total)

The topic ‘posts_nav_link() and query_posts() problem’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [Durgé Seerden](https://wordpress.org/support/users/dsdeur/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/posts_nav_link-and-query_posts-problem/#post-1179710)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
