How to Get Category name from Post ID in wordpress?


Get Category name from Post ID


$category_detail=get_the_category('4');//$post->ID
foreach($category_detail as $cd){
echo $cd
->cat_name;
}

The post How to Get Category name from Post ID in wordpress? appeared first on wpcodekit.

Leave a Reply

Your email address will not be published. Required fields are marked *