How to display the category name in the single post when using WP Blog and Widget?

Question

I am using the free version of WP Blog and Widget plugin for my blog. It’s working perfectly.

My issue is, I have to display the current post category name on my single page. So I tried below code on a single.php page to check the category name.

$cat = get_the_category();
print_r($cat);

but I am not getting the category name. I am getting an empty array.

Array ( ) 

Would you help me out with this?

0
, , , Naren Verma 7 months 0 Answers 87 views 0

Leave an answer