Title: posts_nav_link
Last modified: August 20, 2016

---

# posts_nav_link

 *  [ekennaj](https://wordpress.org/support/users/ekennaj/)
 * (@ekennaj)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/posts_nav_link-4/)
 * So I got this little code on a page called Blog
 *     ```
       <div id="content" role="main">
       		<?php
       		query_posts( 'cat=84&posts_per_page=4');
       		global $more;
       		$more = 0; ?>
   
       		 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   
       		<a href="<?php the_permalink(); ?>" title="<?php 	printf( esc_attr__( 'go to %s', 'twentyten' ), 	the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><h2> <?php the_title();?> </h2></a>
       		 <?php the_content(); ?>
   
       		 <?php endwhile; else: ?>
       		  <p>Sorry, no posts matched your criteria.</p>
       		 <?php endif; ?>
       	</div>
       ```
   
 * Tryed some things to get the next en prev posts of category (blog) loaded. But
   I keep on getting the same posts and not the olders or newer ones.

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

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/posts_nav_link-4/#post-3228322)
 * Is this a [static front page](http://codex.wordpress.org/Creating_a_Static_Front_Page)?
 * Try it with [pagination functions](http://codex.wordpress.org/Pagination#Function_Reference)
   after the endwhile [untested]:
 *     ```
       <div id="content" role="main">
       		<?php
                       if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
       elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
       else { $paged = 1; }
       		query_posts( 'cat=84&posts_per_page=4&paged=' . $paged);
       		global $more;
       		$more = 0; ?>
   
       		 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   
       		<a href="<?php the_permalink(); ?>" title="<?php 	printf( esc_attr__( 'go to %s', 'twentyten' ), 	the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><h2> <?php the_title();?> </h2></a>
       		 <?php the_content(); ?>
       <?php endwhile; ?>
       <!-- pagination -->
       <?php next_posts_link(); ?>
       <?php previous_posts_link(); ?>
       <?php else : ?>
        <p>Sorry, no posts matched your criteria.</p>
       <?php endif; ?>
       </div>
       ```
   
 *  Thread Starter [ekennaj](https://wordpress.org/support/users/ekennaj/)
 * (@ekennaj)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/posts_nav_link-4/#post-3228328)
 * Yesss That did it. Thank you so much [@keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/posts_nav_link-4/#post-3228333)
 * You’re welcome. I’m glad you got it resolved 🙂

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

The topic ‘posts_nav_link’ is closed to new replies.

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/posts_nav_link-4/#post-3228333)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
