• Resolved bgbs

    (@bgbs)


    I have a situation where I have three repeaters in one post. The logic seems to render every repeater as the next post date, not as part of the same post. Any ideas why?

    <ul>
      <Loop type=post count=3 orderby=date order=desc>
        <li>
          <Field title />
          <Loop acf_repeater=repeater-1>
             <Field acf_editor=program_name />
          </Loop>
          <Loop acf_repeater=repeater-2>
            <Field acf_editor=program_name />
          </Loop>
          <Loop acf_repeater=repeater-3 >
            <Field acf_editor=program_name />
          </Loop>
        </li>
      </Loop>
    </ul>
    • This topic was modified 2 years, 3 months ago by bgbs.
Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m not sure I quite understand what you mean when you say that it seems to “ render every repeater as the next post date.” Could you clarify what the expected output of your markup should be (maybe shed a bit of light on your data structure) and what the actual output is?

    Thread Starter bgbs

    (@bgbs)

    I have three ACF repeaters in a post called repeater-1, repeater-2 and repeater-3. I need to display posts on a page that contain three repeaters with content.

    It’s like loop within a loop scenario.

    The loop works, sort of. But what is happening is that the second repeater display content from the second post, and the third repeater displays content from the third post, where as it needs to show content that is in the first post.

    This graphic visually shows the problem and solution I’m seeking:
    https://pasteboard.co/37811D7UpRU5.png

    Thanks.

    Thread Starter bgbs

    (@bgbs)

    aahh, that was it,
    Thanks.

    • This reply was modified 2 years, 3 months ago by bgbs.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Loop is all over the place – need help!’ is closed to new replies.