Using:
ACF 5.9.4
WP 5.6
How do you separate each taxonomy term (on the front-end) when there are multiple terms with a comma separator? Using this page as reference: https://www.advancedcustomfields.com/resources/taxonomy/
<?php
$terms = get_sub_field('message_speaker');
if( $terms ):
foreach( $terms as $term ):
echo esc_html( $term->name );
endforeach;
endif;
?>
$terms = get_sub_field('message_speaker');
$names = array();
if( $terms ):
foreach( $terms as $term ):
$names[] = esc_html( $term->name );
endforeach;
echo implode(', ', $names );
endif;
Thank you @hube2 ! That solved my issue!