I have custom post type products
& custom taxonomy product_type
which has many terms & the products
can have multiple product_type
terms assigned to it Ex. A Samsung TV Model
post has product_type as New arrivals
, featured
& tv
.
I am trying to output only the specific custom taxonomy term [hyperlink] from an array on a single products
post :-
if( has_term( array( 'laptop', 'TV', 'phone', 'tablet' ), 'product_type' ) ) :
// Do stuff here
else :
// DONT SHOW ANYTHING
endif;
?>
entering a text instead of // Do stuff here
in above code works. I want to echo the actual tax term from that array. Tried echo $term;
, echo get_the_term();
but it doesnt work. How do i output the custom term from this array ?