getting current category?
-
I’m trying to return the category ID of the current category but have not had much luck. I’ve tried getting it from the query string as $_GET[‘cat’] which only seems to work if I’m on a category page and I’ve tried using get_the_category() which seems to return all categories used on the entire site (not the current post). How can I get the category ID of the current page regardless if it is a category page or a post?
The topic ‘getting current category?’ is closed to new replies.