wp_get_object_terms comma separated
-
I’m using the following code to get a list of custom taxonomy terms that then get added to the post:
<?php $product_terms = wp_get_object_terms($post->ID, 'skill'); if(!empty($product_terms)){ if(!is_wp_error( $product_terms )){ echo '<ul>'; foreach($product_terms as $term){ echo '<li><a href="'.get_term_link($term->slug, 'skill').'">'.$term->name.'</a></li>'; } echo '</ul>'; } } ?>
This is displayed as list of terms. What I would like is to have a comma separated list with the last item not having a comma.
Is this possible?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp_get_object_terms comma separated’ is closed to new replies.