Ready to get started?Download WordPress


running two loops in one page (5 posts)

  1. booleanlife
    Posted 4 years ago #

    Hi. I am trying to run two loops at a my home page.
    They both work separately but not together... as you
    see I have used

    <?php rewind_posts();?>
    <?php wp_reset_query();?>

    but it seems the first loop is ignored

    here is the whole page...
    and thanks.

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

  2. Samuel B
    Posted 4 years ago #

    be aware that some plugins don't like multiple loops and will bork them

  3. booleanlife
    Posted 4 years ago #

    Thanks samuel. I have read codex and several other sources... I think using update_post_caches($posts); will take care of those plugins... but I still can't run these loops together:
    here is the code:

  4. booleanlife
    Posted 4 years ago #

    the borking problem persists...

  5. so far you haven't described what is not working.

    the code in the pastebin would show the same post twice.

    and it seems to not honor the thematic structure - there is for instance some code such as thematic_postheader(); and the_content() , after you ended the second loop.

    a link to your experimental site would help to illustrate the problem ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic