WordPress.org

Support

Support » How-To and Troubleshooting » My Incredible Loop Challenge!!! Think You Know Loops? Please Help!

My Incredible Loop Challenge!!! Think You Know Loops? Please Help!

  • 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!

Viewing 1 replies (of 1 total)
  • 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!

Viewing 1 replies (of 1 total)
  • The topic ‘My Incredible Loop Challenge!!! Think You Know Loops? Please Help!’ is closed to new replies.