Quantcast
Channel: Tagged with repeater - Plugin Support
Viewing all articles
Browse latest Browse all 160

Does ACF Repeater Field generate unique ID's?

$
0
0
My code below is looping through a repeater field which works a treat. My question is does ACF generate unique ID's for each repeated element?

In my code below I'm trying to add a unique ID for each section that is outputted. For example, if there are 5 sections where content needs outputting I'd like the first section to get an ID of 's-1', the second section 's-2', the third 's-3' and so on. How can I do this?



<?php if(get_field('section')): ?>
<?php while(has_sub_field('section')): ?>


<?php the_sub_field('left_column'); ?>



<?php the_sub_field('Right_column'); ?>




<?php endwhile; ?>
<?php endif; ?>



Viewing all articles
Browse latest Browse all 160

Trending Articles