Step 1: First we have to get the post id
global $posts;
$post_id = $posts->ID;
Step 2: After the get the post id, then we get the category is very simple.
$category = get_the_category($postID);
$category_name = $category->cat_name – See more at: http://phprockers.blogspot.in/2012/01/get-category-name-from-post-id-in.html#sthash.MZNWFF93.dpufStep 1: First we have to get the post id
global $posts;
$post_id = $posts->ID;
Step 2: After the get the post id, then we get the category is very simple.
$category = get_the_category($postID);
$category_name = $category->cat_name – See more at: http://phprockers.blogspot.in/2012/01/get-category-name-from-post-id-in.html#sthash.MZNWFF93.dpuf