Comma separated ACF Repeater except for last row.
<?php $variable = get_sub_field('repeater_field'); ?>
<?php if ( $variable ): ?>
<?php $notLast = $variable;
foreach ($variable as $v ): ?>
<?php the_field('field_name', $v); if (next($notLast)) { echo ','; } ?>
<?php endforeach; ?>
<?php endif; ?>
Top comments (0)