Title: getting current category?
Last modified: August 19, 2016

---

# getting current category?

 *  [warpdesign](https://wordpress.org/support/users/warpdesign/)
 * (@warpdesign)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/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.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [id](https://wordpress.org/support/topic-tag/id/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [warpdesign](https://wordpress.org/support/users/warpdesign/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/getting-current-category/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
