• tctc

    (@tctc)


    hi everyone… getting crazy with this issue:

    I have correctly implemented page navigation for my site and it works fine. Really good job! ??
    The problem is that the last set of posts is not displaying correctly: it just mess up the style and “No articles” is written even if there are still 2 posts to display.
    It seems the pagination is not working if there are less than 10 posts to display (the query is set to display 10 posts max).

    The code of the page is:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    There are 2 loops inside the page. the primaty one which is paginated and the second one in the sidebar.

    Anyone has an idea why the last set of posts to display does not work? Please help! Already searched everywhere but without success!

Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter tctc

    (@tctc)

    And this is the result of the 17th page of the category with 330 posts:

    QUERY STRING: paged=17&category_name=mag%2Feventi-contest

    vtxyzzy

    (@vtxyzzy)

    I am sorry to have to do this, but I need to see the $wp_query. It will print a lot of data, but can you please leave it up for me to see?

    Be sure to put the line between the query and the if (have_posts()), like this:

    <?php global $query_string; query_posts($query_string . '&showposts=10' ); ?>
    <?php print_r($wp_query); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    Thread Starter tctc

    (@tctc)

    here you are and thanks a lot for that!

    [Query moderated as per the Forum Rules. Please use the pastebin in future. I’ve created a pastebin link for you this time.]

    https://wordpress.pastebin.com/pNW2ZNWk

    Thread Starter tctc

    (@tctc)

    all the content gave back from <?php print_r($wp_query); ?> is:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    vtxyzzy

    (@vtxyzzy)

    OK – you can take it out now. Do you see the problem? Look at the posts_per_page about half way down – it says posts_per_page => 20, not 10.

    Try changing from &showposts=10 to posts_per_page=10, like this:

    <?php global $query_string; query_posts($query_string . '&posts_per_page=10' ); ?>
    vtxyzzy

    (@vtxyzzy)

    Got to go to dinner now, back in 1 hour.

    Thread Starter tctc

    (@tctc)

    well… got to go sleep it’s 1 o’clock here in Italy! Sorry for big pasting, didn’t know about pastebin….
    I really really appreciate your help… I really have no idea on how to solve this problem, even if I’ve already solved all the problem with this site except this one…… ??
    I’ll be back tomorrow morning…thank you very much again!

    Thread Starter tctc

    (@tctc)

    Incredible IT WORKS!!!!! but only if posts_per_page is set to 20 . I f I set it to 10 then there are the common problems explained before…. but it already a big step!
    Now the question is… how is it possible to set it to 10 posts without having the problems? Where is this problem?!?

    thank you a lot anyway… really good help! we miss a small step now!

    Thread Starter tctc

    (@tctc)

    Ok! Solved!! I had to change the configuration in Admin > Settings > Reading and set post to display to 10 like the number of posts_per_page !!

    I have to really thanks vtxyzzy for the precious help! THANKS A LOT!

    vtxyzzy

    (@vtxyzzy)

    Changing the Settings to 10 is just part of the problem. I think your theme is forcing all queries to the same number of posts per page. You may not want that.

    I tried to locate your theme to download it and look for the cause, but I could not find the theme. Can you post a link to its download site?

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘pagination problem with last set’ is closed to new replies.