gera3d
3/24/2017 - 6:55 PM

Return a list of all 'product' taxonomy terms that are applied to.

Return a list of all 'product' taxonomy terms that are applied to.

$product_terms = wp_get_object_terms( $post->ID,  'product' );
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, 'product' ) . '">' . esc_html( $term->name ) . '</a></li>'; 
			}
		echo '</ul>';
	}
}