• my ‘next_posts_link’ works for page 2 ok but page 3 gets a 404, why would that happen? thanks

    here is my code:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args= array( 'posts_per_page' => '5', 'paged' => $paged ); query_posts($args); ?>
    <!-- Start the Loop. -->
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <!-- Display the Post's Content -->
    <article>
    <h1><?php the_title(); ?></h1>
    <div class="dashedline"></div>
    <?php the_content(); ?>
    </article>
    <!-- Stop The Loop (but note the "else:" - see next line). -->
    <?php endwhile; ?>
    <h4><?php next_posts_link('Older Posts') ?> - <?php previous_posts_link('Newer Posts') ?></h4>
    <?php else: ?>
    <!-- The very first "if" tested to see if there were any Posts to -->
    <!-- display.  This "else" part tells what do if there weren't any. -->
    <h1>Page not found</h1>
    <p>Sorry, that page no longer exists. The page may have been removed or you have followed an obsolete link.
    Please use the site's navigation menus to try again.</p>
    <!-- REALLY stop The Loop. -->
    <?php endif; ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘blog pagination only partiallly works’ is closed to new replies.