The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End multiple loop issue – previous posts page is wrong!?

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #27524


    i have been trying to do something similar to css-tricks in showing my newest post in a different way to the other posts on the page. that seems all good, however when you click on "older posts" it has a problem as it still shows the newest post on each page, and doesn’t work in the same way css-tricks does.

    could someone help me on this one please? i would really appreciate it.

    this is the site i have the problem on (i know its crap but i am trying!)

    here is my code… (thanks in advanced)

    do i need a conditional statement to only do it on the home page like <?php if (is_home()) { } ?> ??? if so can someone show me the way? cheers


    have_posts()) : $my_query->the_post();
    $do_not_duplicate = $post->ID;?>

    ” rel=”bookmark” title=”Permanent Link to “>

    ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>

    ” rel=”bookmark” title=”Permanent Link to “>

    Not Found

    Sorry, but you are looking for something that isn’t here.



    Just wanted to bump this again. (I won’t keep doing it and piss everyone off).

    I have searched for ages for a fix on this but have still not found the info i am looking for, can anyone help?



    It is a fine question, and I feel like I know the answer, but it isn’t coming to me at the moment.

    I’ll ponder it some more, but hopefully Chris catches this one first!


    thanks! any help would be gratefully recieved!!


    ok so i have been on a wordpress forum and got this info…

    $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    if ($paged < 2) {
    // DO STUFF

    The guy basically said that this would say that this would check if it was page 1, and do stuff accordingly. I had a quick go and couldn’t work out how to use it with 2 loops because my knowledge is pretty lacking!

    what do you think Doc? or anyone else that fancies being my hero!?!!?

    Thank you!

    Chris Coyier

    Yeah you gotta check if you are on a paginated page for that first query. Otherwise that first query has no idea and will just grab the most recent post. You don’t need to do that fancy stuff to know if a post is paginated though, you can just:

    if ($paged) {
    // do stuff

    The $paged variable is equal to the # of page you are on. So if you are at /page/2, $paged will be 2. You can use that number to offset the query. Like

    if ($paged) {

    That offset parameter will skip the first X posts. You’ll need to adjust as needed. As in, if you show 5 posts per page, you’ll need to offset by 6 on page two, so you’ll need to do like:

    $offset = (5 * $paged) + 1;

    All covered in Digging Into WordPress — wink wink.

    John Tanedo

    got similar issue on my blog … it just doesn’t work here is my codes



    Posted on: at


    hope someone can help. . . i got the dig-wp book btw but dont know which chapter to get around this problem is it page 95?


    Here’s my code…
    I have the first post looking different ONLY on the first page… I use pagenavi for pagination.


    I need some help with this too…links keep reverting back to the new entries and not the older ones.

    I’ve been adding the suggested code above from Chris into my bloghome.php file but its not happening for me.
    blog page is;.can anyone lend a hand =D

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Back End’ is closed to new topics and replies.