• Resolved recessintraining

    (@recessintraining)


    Hey, my website’s blog: https://www.at-first-sight.ca/blog currently doesn’t show the correct posts on page 2, or any sequential pages after that. It shows the same loop on the first page. I’m sure there’s something small I’ve missed, but I can’t seem to find it.

    Here’s what I have in the content area on that page:

    <?php if (have_posts()) : ?>
    
    <?php query_posts('category_name=blog&showposts=8'); ?>
    
    <?php while (have_posts()) : the_post(); ?>
    " rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
    <?php the_time('l, F jS, Y') ?>
    
    <?php the_content() ?>
    
    <?php endwhile; ?>
    
    <!-- End Blog Posts -->
    
    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    <?php } ?>
    
    <!-- Next / Back Links -->
    <?php posts_nav_link(); ?>
    
    <!-- Page Not Found -->
    <?php else :
    if ( is_category() ) { // If this is a category archive
    printf("<h2 class='center'>Sorry, but there aren't any posts in the %s category yet.</h2>", single_cat_title('',false));
    } else if ( is_date() ) { // If this is a date archive
    echo("<h2>Sorry, but there aren't any posts with this date.</h2>");
    } else if ( is_author() ) { // If this is a category archive
    $userdata = get_userdatabylogin(get_query_var('author_name'));
    printf("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", $userdata->display_name);
    } else {
    echo("<h2 class='center'>No posts found.</h2>");
    }
    get_search_form();
    endif;
    ?>
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter recessintraining

    (@recessintraining)

    Every time I hop out of wordpress for a few months, and back in – I forget everything ??

    Thread Starter recessintraining

    (@recessintraining)

    Perhaps this is a premature presumption, but in researching similar topics, a lot of them have been closed due to no one responding/posting. I’ll just stick to spending hours finding the issue myself, as there seems to be a smaller and smaller community on here. Correct me if I’m wrong ??

    It’s because you’re wiping out the paged query vars by declaring the query parameters (ie. query_posts).

    Try replacing.

    <?php query_posts('category_name=blog&showposts=8'); ?>

    ..with..

    <?php
    $paged = ( get_query_var('paged') ) ? (int) get_query_var('paged') : 1;
    query_posts('paged=' . $paged . '&category_name=blog&showposts=8');
    ?>

    See if that helps.. ??

    Thread Starter recessintraining

    (@recessintraining)

    Oh my… t31os_ Thank-you so much (and for the quick response). That indeed helped, and makes sense.

    You’re welcome… ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Getting multiple pages to work’ is closed to new replies.