• I am using the following on a category specific template file:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts($paged . "&showposts=5&cat=3&paged=$paged");
    ?>

    The first couple pages work, but when I click the 3rd or any more pages, I get nothing found?

    Did something change with paging using the method above?

Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts($paged . "&showposts=5&cat=3&paged=' .$paged);
    ?>
    Thread Starter Jacorre

    (@jacorre)

    Hi esmi, I tried using the following:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts($paged . '&showposts=5&cat=3&paged=' .$paged);
    ?>

    It didn’t make a difference. Again, only the first two pages worked, any page after that does not work.

    I’m noticing that it seems to happen with category specific template files.

    For example, this one uses category-3.php. Any other template file where I use the same query posts with paging, it’s not a problem.

    You could try swapping showposts for posts_per_page.

    Thread Starter Jacorre

    (@jacorre)

    I have also tried swapping that out.

    If I do not use query_posts, the paging works but I want to define a different number of posts per page so that’s why I want to use query_posts.

    If I introduce query posts as follows:

    <?php global
    $query_string;
    $posts = query_posts($query_string.'&posts_per_page=5&cat=3');

    I no longer get an issue with clicking on page 3 and it not finding any posts. However, it stops at that point and doesn’t provide the rest because I know there’s more than 15 entries. Very strange.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘query posts and paging issue with older posts’ is closed to new replies.