Get the current taxonomy product category title in woocommerce

You could use get_the_term_list

echo get_the_term_list( $post->ID, 'product_cat', '<div style="direction:rtl;">', '</div>', '' ); 

The system of displaying 1 category title on a single product page fails if you start adding the item to multiple categories.

I went crazy once on a project where a client was adding portfolio items to two categories and yet somehow wanted me to show the ‘right’ category title depending. That project led me to create the Radio Buttons for Taxonomies plugin to restrict users to a single term in certain taxonomies.

Leave a Comment