-
Hi, I have a custom taxonomy (geolocation) for a CPT (casino_review). How can I echo the primary taxonomy term in this case please?
I saw this code on a couple of other threads, it would be great to know which part is which so I can adapt and use it:
$primary_cat_id = get_post_meta( $product->id, 'rank_math_primary_category', true ); if ( $primary_cat_id ) { $product_cat = get_term( $primary_cat_id, 'product_cat' ); $markup['brand'] = $product_cat->name; }
Thanks!
The ticket ‘Echo Primary Category’ is closed to new replies.