How to get the cat id of a custom post type?
-
Hello,
I’m on a custom post type page and I’m using the code
function getCurrentCatID(){
global $wp_query;
$cat_ID = get_query_var(‘cat’);
return $cat_ID;
}to get the category id but it’s not bringing anything back, it works on normal posts. Anyone got any ideas?
Thanks
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How to get the cat id of a custom post type?’ is closed to new replies.