Title: &quot;Next Posts&quot; link not working
Last modified: August 20, 2016

---

# "Next Posts" link not working

 *  [Dayr12](https://wordpress.org/support/users/dayr12/)
 * (@dayr12)
 * [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/)
 * I cannot seem to get my “next posts” and “previous posts” links to work. At the
   bottom of my index.php I want visitors to navigate to “older posts” and “new 
   posts”. Pretty simple right?
 * Well I followed the advice in the [Codex](http://codex.wordpress.org/Next_and_Previous_Links).
   But no luck. Instead, when you click on the “older posts” link, the home page
   reloads with the newest three posts, not the three after those.
 * Any help would be really appreciated!! I know I’m missing something…
 * Here’s what my loop is looking like:
 *     ```
       <?php
       if ( is_home() ) {
       	query_posts( 'cat=-3' );
       }
       ?>
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
   
       	<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
   
       		<div class="date "><span class="floatleftdate"><?php the_time('M j') ?><br /><?php the_time('Y') ?></span></div>
   
       	    <h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
       		<div class="date-inline meta"><?php the_time('F j, Y') ?></div>
   
       		<div class="entry">
       			<?php the_content('<div class="readmore">Read More »</div>'); ?>
       		</div>
   
       		<div class="clear">
       		</div>
   
       	</div>
   
       <?php endwhile; ?>
   
       <div class="navigation">
       	<div class="next-posts"><p><?php next_posts_link('Older Posts »') ?></p></div>
       	<div class="prev-posts "><?php previous_posts_link('« Newer Posts') ?></div>
       </div>
   
       <?php else : ?>
   
       	<h2>Not Found</h2>
   
       <?php endif; ?>
       ```
   

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

 *  [egado](https://wordpress.org/support/users/egado/)
 * (@egado)
 * [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/#post-2730578)
 * Can you please post a link?
 *  Thread Starter [Dayr12](https://wordpress.org/support/users/dayr12/)
 * (@dayr12)
 * [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/#post-2730580)
 * oops! Here it is: [http://ipolitech.com/](http://ipolitech.com/)
 *  [egado](https://wordpress.org/support/users/egado/)
 * (@egado)
 * [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/#post-2730587)
 * Can you try to move
 *     ```
       <div class="navigation">
       	<div class="next-posts"><p><?php next_posts_link('Older Posts »') ?></p></div>
       	<div class="prev-posts "><?php previous_posts_link('« Newer Posts') ?></div>
       </div>
       ```
   
 * after this <?php endif; ?>
 * just for make a test…
 *  [egado](https://wordpress.org/support/users/egado/)
 * (@egado)
 * [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/#post-2730591)
 * And try this change pls, without doing what i’m posted before…
 * **find**
 *     ```
       query_posts( 'cat=-3' );
       ```
   
 * **replace with**
 *     ```
       query_posts( 'cat=-3&posts_per_page=3' );
       ```
   
 * Let me know 🙂
 *  Thread Starter [Dayr12](https://wordpress.org/support/users/dayr12/)
 * (@dayr12)
 * [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/#post-2730592)
 * Just moved it down there and the same problem exists. Still reloading the first
   three posts instead of moving on. Any other suggestions? Thanks for your help,
   btw!
 *  [egado](https://wordpress.org/support/users/egado/)
 * (@egado)
 * [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/#post-2730593)
 * see above 😉
 *  Thread Starter [Dayr12](https://wordpress.org/support/users/dayr12/)
 * (@dayr12)
 * [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/#post-2730595)
 * Still the same issue… Would it help to place the loop in it’s own php file and
   call that in the index? Someone mentioned that might help, but I don’t see why.
 *  [egado](https://wordpress.org/support/users/egado/)
 * (@egado)
 * [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/#post-2730596)
 * hmm strange… maybe this site helps your… musst be a query issue…
    - [http://weblogtoolscollection.com/archives/2008/04/19/paging-and-custom-wordpress-loops/](http://weblogtoolscollection.com/archives/2008/04/19/paging-and-custom-wordpress-loops/)
    - [http://www.rizwanashraf.com/2009/01/24/wordpress-nextprevious-page-links-problem-query_post-pagination-problem/](http://www.rizwanashraf.com/2009/01/24/wordpress-nextprevious-page-links-problem-query_post-pagination-problem/)
 *  Thread Starter [Dayr12](https://wordpress.org/support/users/dayr12/)
 * (@dayr12)
 * [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/#post-2730705)
 * Howdy! I checked out those links… it looks like if it’s a query problem caused
   by excluding a category at the outset of my loop. I could have changed around
   the loop it looks like, but I don’t know PHP well enough to start hacking at 
   that a ton.
 * Long story short, I downloaded [a plugin ](http://wordpress.org/extend/plugins/advanced-category-excluder/)
   to take care of excluding my category, and got rid of the script that was screwing
   up my pagination. Seems like a WP bug to me!
 * Anyway, thanks a ton for your help egado! All works now!
 * Robbie

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

The topic ‘"Next Posts" link not working’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 2 participants
 * Last reply from: [Dayr12](https://wordpress.org/support/users/dayr12/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/next-posts-page2-problem/#post-2730705)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
