Hey, I'm building a new site and want to style posts in a certain category differently than the others. Different background image, basically. What's the best strategy for this kind of thing?
Thanks --
Hey, I'm building a new site and want to style posts in a certain category differently than the others. Different background image, basically. What's the best strategy for this kind of thing?
Thanks --
Create Category templates where you could add CSS ID's or classes etc to be able to style respective categories differently
Right, that's how I do it for category pages. But how can I style post pages, "single.php" differently depending on what category the post is in?
I see you're using WP 2.8. Unknown to some, there is a new body_class tag which will allow themers to add more style to certain posts. Check out
http://wpengineer.com/wordpress-28-body_class-automatic_feed_links/
http://www.nathanrice.net/blog/wordpress-2-8-and-the-body_class-function/
There's a plugin but haven't tested it for 2.8
http://wordpress.org/extend/plugins/post-template/
In your single.php file using conditional tags:
http://codex.wordpress.org/Conditional_Tags
http://codex.wordpress.org/Template_Tags/in_category
Great, I'll look that stuff over. body_class sounds like a winner.
You must log in to post.