How to Increment ID value within ACF Repeater Field Loop
Try using a “counter” variable for the loop maybe? <?php if ( get_field(‘ingredients-list’) ) { echo ‘<ul class=”ingredientsList”>’; $count=0; while ( has_sub_field(‘ingredients-list’) ) { echo ‘<li class=”ingredient” itemprop=”ingredients”> <label for=”check-‘. $count .'”> <input type=”checkbox” class=”check” id=”check-‘. $count .'”> ‘; if ( get_sub_field(‘quantity’) ) echo ‘<span class=”quantity”>’ . get_sub_field(‘quantity’) . ‘</span> ‘; if ( get_sub_field(‘measurement’) ) … Read more