I have a repeater in Woocommerce categories where the admin can select categories.
I have chosen Term ID and can output the chosen image and URL, but I can’t seem to get the term name.
I’ve tried;
<?php echo esc_html( $post_id->name ); ?>
<?php woocommerce_page_title($post_id); ?>
<?php echo $post_id->cat_name; ?>
<?php echo '<p>'. get_the_category( $post_id )[0]->name .'</p>'; ?>
<?php echo esc_html( $post_id[0]->name ); ?>
None work…..
Anyone got any ideas, please?
You will need to get the term or you will need to return term objects from the field rather than ID.