Hi,
I have a group field named : parent,
and subfields: father, mother. i’m not sure how to show them on frontend with comma separated if both subfields are available.
please help me. currently i’m using this nonsense code:
`<tr>
<?php if( have_rows(‘parent’) ): ?>
<?php while( have_rows(‘parent’) ): the_row();
// Get sub field values.
$father = get_sub_field(‘father’);
$mother = get_sub_field(‘mother’);
?>
<td>parents</td>
<td>
<ul class=”list-group list-group-flush”>
<?php if( get_sub_field(‘father’) ): ?>
<li class=”nobullet”>” target=”_blank”><?php the_sub_field(‘father’); ?> (father)<?php endif; ?>
<?php if( get_sub_field(‘mother’) ): ?>
<li class=”nobullet”>” target=”_blank”><?php the_sub_field(‘mother’); ?> (mother)<?php endif; ?>
</td>
<?php endwhile; ?>
<?php endif; ?>
</tr>