WordPress.org

Ready to get started?Download WordPress

Forums

My Incredible Loop Challenge!!! Think You Know Loops? Please Help! (2 posts)

  1. velocegatto
    Member
    Posted 1 year ago #

    Hi Guys!

    I need to create a loop that can logically be described as the following for a carousel:
    Requirements:
    - 3 Loops
    - 2 Posts Per Loop
    - No Duplicates
    - Order by Post Date

    < Start Loop #1 >

    < Post #1 >
    < Post #2 >

    < End Loop #1 >

    < Start Loop #2 >

    < Post #3 >
    < Post #4 >

    < End Loop #2 >

    < Start Loop #3 >

    < Post #5 >
    < Post #6 >

    < End Loop #3 >

    Ideally, I would like a solution that could carry on infinite loops this way with no duplicates. I looked in the codex, but I could not find a solution that fit with my code shown here: http://pastebin.com/LitYb0wh

    Would love to get some help on this!

    Thanks in advance!

  2. velocegatto
    Member
    Posted 1 year ago #

    I should add that the carousel displays 2 posts at a time, each in it's own div. You can see this in the example code I give.

    Therefore, I need the loop to work with this type of structure:

    <ul>
    
    <li>
    <div>Post 1</div>
    <div>Post 2</div>
    </li>
    
    <li>
    <div>Post 3</div>
    <div>Post 4</div>
    </li>
    
    <li>
    <div>Post 5</div>
    <div>Post 6</div>
    </li>
    
    </ul>

    Thanks everyone!

Topic Closed

This topic has been closed to new replies.

About this Topic