Loop variables

Use the Get tag and variable type loop to access variables related to loop.

<Get loop=count />
  • count - Current loop count, an index starting from 1
  • total - Total number of items in current loop
  • previous_total - Total number of items in previous loop, after it's closed

Field loop

For fields that are loop instances, like a list or ACF repeater, use the field attribute (or ACF field type) to specify the field name.

For example, to get the number of total items in a repeater field:

<Get loop=total acf_repeater=field_name />