Hi,
I have built a form with the repeater field, but I don’t know how to add element checked=”checked” to only first item in the loop?
<?php if( have_rows('repeater_field_name') ): ?>
<form>
<?php while ( have_rows('repeater_field_name') ) : the_row(); ?>
<!-- first item/row -->
<input type="radio" checked="checked">
<label><?php the_sub_field('sub_field_name'); ?></label>
<!-- next items/rows -->
<input type="radio">
<label><?php the_sub_field('sub_field_name'); ?></label>
<input type="radio">
<label><?php the_sub_field('sub_field_name'); ?></label>
etc.
<?php endwhile; ?>
</form>
<?php endif; ?>
Many thanks