How to get current category’s name and ID:
<?php foreach((get_the_category()) as $category) { $postcat= $category->cat_ID; $catname =$category->cat_name; //echo $postcat; //echo $catname; } ?>
Revisions
There are no revisions for this post.
How to get current category’s name and ID:
<?php foreach((get_the_category()) as $category) { $postcat= $category->cat_ID; $catname =$category->cat_name; //echo $postcat; //echo $catname; } ?>
There are no revisions for this post.
You must be logged in to post a comment.
No comments yet.