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

In my blog, my "pages" are really just posts sorted by categories. What's the best way to change the way the posts look for one of my category pages?

share|improve this question
up vote 1 down vote accepted

For styling archive index pages for a given category, target body.category-slug (where slug is the category slug) in CSS.

For styling single blog posts that have a given category, assuming your post container is a div, target div.category-slug (where slug is the category slug) in CSS.

For PHP operations, you can also use is_category( 'slug' ), which returns true if you are on the archive index page for a given category, and you can use in_category( 'slug' ) which returns true if the current post is in a given category.

share|improve this answer
Cool! Just what I was looking for. – Dan Jun 22 '11 at 14:22

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.