Title: post_nav_link / next_posts not working &#8211; php help!
Last modified: August 19, 2016

---

# post_nav_link / next_posts not working – php help!

 *  [danaherlihey](https://wordpress.org/support/users/danaherlihey/)
 * (@danaherlihey)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/post_nav_link-next_posts-not-working-php-help/)
 * I have my page template set up with this code included:
 *     ```
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
   
       			<h1><?php the_title(); ?></h1>	
   
                   <hr />
       				<?php the_content('<p>Read the rest of this page &rarr;</p>'); ?>
       				<? /*php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); */?>
   
       			<?php endwhile; endif; ?>
   
       			<?php
       			if (is_page('news') ){
       	       query_posts("category_name=news&showposts=5");
       		   include (TEMPLATEPATH . '/summarydisp.php');
       		   }
       		   ?>
   
               <?php
       			if (is_page('features') ){
       	       query_posts("category_name=features&showposts=1");
       		   include (TEMPLATEPATH . '/summarydisp.php');
   
       		   }
       		   ?>
       ```
   
 * It works great, and gives me both static content and the posts i requests.
 * In /summardisp.php I have the following:
 *     ```
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
   
       			<h2><a href="<?php the_permalink() ?>" rel="bookmark" title=" <?php the_title(); ?>"><?php the_title(); ?></a></h2>
                   <h4><?php the_time('F jS, Y') ?></h4>
       			<?php /*?><!-- by <?php the_author() ?> --> &middot; <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?><?php */?>
   
       			<?php the_tags('Tags: ',' , ','<br />'); ?>
       			<?php global $more; $more = false; ?>
       				<?php the_content('<div id="more">[lang_en]continue reading &rarr; [/lang_en][lang_es]Leer más &rarr;[/lang_es] </div>'); ?>
                       <?php $more = true; ?>
   
       			<?php /*?>if ('open' == $post-> comment_status) { ?>
       			<p class="tagged"><a href="<?php the_permalink() ?>#comments"><?php comments_number('No Comments', '1 Comment', '% Comments'); ?></a></p>
   
       			<?php } else { ?>
   
       			<?php */?>
   
       			<?php endwhile; endif; ?>
   
                   <?php include (TEMPLATEPATH . '/navigation.php'); ?>
       ```
   
 * Which also works fine.
 * the template file navigation.php looks like this:
 *     ```
       <?php if (is_single()) : ?>
       <div id="postnavigation">
   
           <span class="fl"><?php previous_post_link('&larr; %link') ?></span>
           <span class="fr"><?php next_post_link('%link &rarr;') ?></span>
           <br />
   
       </div>
       <div class="cl"></div>
   
       <?php else : ?>
   
       <div id ="pagenavigation">
           <span class="fl"><?php posts_nav_link('','','&laquo; Previous Entries') ?></span>
       	<span class="fr"><?php posts_nav_link('','Next Entries &raquo;','') ?></span>
          </div>
          <div class="cl"></div>
       <?php endif; ?>
       ```
   
 * Which, theoretically should work fine.
 * The problem is, a page that is only supposed to show one article and then paginate
   through previous and next posts, doesn’t. It goes to the next page but the same
   article appears.
 * you can see what i mean here:
    [http://danaherlihey.com/wordpress/features/](http://danaherlihey.com/wordpress/features/)
 * im not all that php savy so any help that could be provided would be great. it
   seems like a problem with looping but i can’t quite figure it out.

Viewing 1 replies (of 1 total)

 *  [iridiax](https://wordpress.org/support/users/iridiax/)
 * (@iridiax)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/post_nav_link-next_posts-not-working-php-help/#post-797740)
 * Pages are not like your index, archives, or categories and not meant to paginate
   through your posts. If you use conditional tags and/or custom templates, you 
   can mix static and dynamic content on category pages.
 * Also, you need to [validate and fix your code](http://validator.w3.org/check?uri=http%3A%2F%2Fdanaherlihey.com%2Fwordpress%2Ffeatures%2F&charset=%28detect+automatically%29&doctype=Inline&ss=1&group=0)
   because you have some _major_ code errors that can cause all sorts of strange
   problems.

Viewing 1 replies (of 1 total)

The topic ‘post_nav_link / next_posts not working – php help!’ is closed to new 
replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [post_nav_link](https://wordpress.org/support/topic-tag/post_nav_link/)
 * [the-loop](https://wordpress.org/support/topic-tag/the-loop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [iridiax](https://wordpress.org/support/users/iridiax/)
 * Last activity: [17 years, 11 months ago](https://wordpress.org/support/topic/post_nav_link-next_posts-not-working-php-help/#post-797740)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
