Home › Forums › ACF PRO › Separate Custom Taxonomy By Comma › Reply To: Separate Custom Taxonomy By Comma
https://codex.wordpress.org/Debugging_in_WordPress, sometimes little bugs, like missing semicolons, happen when people post code on a forum. How do you debug any code you create yourself?
<?php
$terms = get_field('location_type');
if( $terms ):
$total = count($terms);
$count = 1;
foreach( $terms as $term ):
?>
<a href="<?php
echo get_term_link( $term ); ?>"><?php
echo $term->name; ?></a>
<?php
if ($count < $total) {
echo ', ';
}
$count++;
endforeach;
endif;
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.