ACF Repeater Loop

Hi,

the acf_repeater loop is not reseting properly.

If I run following code to get the first line of an acf_repeater:

<Loop acf_repeater=repeater_name count=1>

it works properly and I get only the result of the first repeater item.

When I now add directly below the loop another loop for the same repeater like

<Loop acf_repeater=repeater_name >
  <Field repeater_subfield /> // Shows only two of three items leaving the first one out
</Loop>

the results leave out the first row I just looped.

So I need to add between both repeaters following code to get the full list again.

<Loop acf_repeater=repeater_name ></Loop>

resulting to following code:

<Loop acf_repeater=repeater_name count=1>
  <Field repeater_subfield />
</Loop>

<Loop acf_repeater=repeater_name ></Loop>

<Loop acf_repeater=repeater_name >
  <Field repeater_subfield /> // Now showing all three items of the repeater
</Loop>

This does not seem to be the best way to have it. :slight_smile:

Thanks for the heads up! This doesn’t seem like expected behaviour to me. I’ll pass this along to the dev team :slight_smile:

Thanks for supplying your workaround, too! I’m glad you were able to make it work in the interim

1 Like