• I can’t seem to get the previous posts link to work, I keep getting a 404. The code in its current state is as below:

    <div id="posts-list" class="grid_6">
                    <h2><?php single_cat_title(); ?></h2>
                    <?php
    				query_posts($query_string . '&posts_per_page=3');
                    if ( have_posts() ) {
                    while ( have_posts()) : the_post(); ?>
    
                      <div class="post">
                          <a href="<?php the_permalink() ?>"><h4><?php the_title_attribute(); ?></h4>
                          Published date: <abbr class="published" title="<?php the_time(__('l, F jS, Y, g:i a', 'example')); ?>"><?php the_time(__('F j, Y', 'example')); ?></abbr></a>
                      </div>
                  <?php endwhile; ?>
    
                    <div>
                    <?php posts_nav_link(' · ', 'Previous Page', 'Next Page');
    
    				}
    
    				?>
    
                    </div>
    
                <!-- <div class="alignleft nav"><?php //posts_nav_link('','','&laquo; Previous') ?></div>
                <div class="alignright nav"><?php //posts_nav_link('','Next &raquo;','') ?></div> -->
    
          </div><!-- POSTS LIST CONTAINER ENDS HERE -->
Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator t-p

    (@t-p)

    codex guides:

    -http://codex.ww.wp.xz.cn/Template_Tags/posts_nav_link
    -http://codex.ww.wp.xz.cn/Template_Tags/next_post
    -http://codex.ww.wp.xz.cn/Template_Tags/previous_post
    -http://codex.ww.wp.xz.cn/Function_Reference/query_posts#Pagination_Parameters

    Thread Starter gerald.pereira

    (@geraldpereira)

    Thank you for the reply, but I already read through the codex entries and returned with nothing.

    I switched to the next_posts and previous_posts tags but they didn’t do much either.

    I should also add that it works when I set the limit on the “Reading” panel to the same number. But will it affect all other loops I’m using as well? I’ve manually set the show_posts parameter in all of the others, and they seem to display the correct amount.

    Moderator t-p

    (@t-p)

    Thread Starter gerald.pereira

    (@geraldpereira)

    Looks promising!

    Everything seems to work for the moment, but I’ll try out the stuff on that thread as well, the current set-up doesn’t seem right.

    Thanks for the help!

    Moderator t-p

    (@t-p)

    You are welcome. 🙂

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

The topic ‘Posts nav link returns a 404 on category.php’ is closed to new replies.