WordPress.org

Ready to get started?Download WordPress

Forums

running two loops in one page (5 posts)

  1. booleanlife
    Member
    Posted 3 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();?>

    and
    update_post_caches($posts);
    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
    moderator
    Posted 3 years ago #

    http://codex.wordpress.org/The_Loop#Multiple_Loops
    be aware that some plugins don't like multiple loops and will bork them

  3. booleanlife
    Member
    Posted 3 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:
    http://wordpress.pastebin.ca/1917776

  4. booleanlife
    Member
    Posted 3 years ago #

    the borking problem persists...

  5. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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

Tags