Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.