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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)