Support

Account

Home Forums General Issues How to display the number of the row of the repeater field ? Reply To: How to display the number of the row of the repeater field ?

  • Hi!

    Since you’re probably outputting the repeaterfield in a while loop you can use a counter for the steps:

    
    <?php
    $i = 1;
    while(has_sub_field('myrepeaterfield')):
    ?>
    <p>Step <?php echo $i; ?></p>
    
    <?php
    $i++;
    endwhile;
    ?>