Get custom category name from ID

See the inline comments. Not tested. The following code will grab all the Custom Taxonomy Terms of Custom Taxonomy ‘product-cat’ and will show them one by one from the result array.

<?php
global $post;
$postID = $post->ID //get/put your post ID here
$getProductCat = get_the_terms( $postID, 'product-cat' ); //as it's returning an array
foreach ( $getProductCat as $productInfo ) {
    echo $productInfo->name;
}

Leave a Comment