marko krstić

Collections

Archives

Display Taxonomy in post loop in ACF Relationship field

<?php $terms = get_the_terms( $p->ID, 'product_cat' );
	foreach ($terms as $t) {
	echo $t->name, ' ';
} ?>

Product cat is category name for WooCommerce products category.

Thanks, Hammad Wali for sharing this useful code!

Let's Connect

Feel free to reach out for collaborations or just a friendly hello ?
[email protected]
linkedininstagramdribbblefacebook-official