WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When displaying a category how can I tell what category it is? Say I'm on http://www.example.com/category/quotes, how can I get quotes aside from parsing the URL? I tried get_the_category() but it returns an array of all the categories of the first post shown in the page.

share|improve this question
up vote 2 down vote accepted

This should get you category object with ID, slug and rest of info:

share|improve this answer
thanks that was it – Matteo Riva Nov 3 '10 at 7:48

You can get the category name with:


Reference: http://codex.wordpress.org/Function_Reference/single_cat_title

share|improve this answer
thanks for pointing me to that function, unfortunately I can only accept one answer and I picked Rarst's as I can make good use of the extra info returned by that method – Matteo Riva Nov 3 '10 at 7:49
No problem! You are welcome. – sorich87 Nov 3 '10 at 8:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.