Hey Vivien- I’d be interested to hear whether there’s a way of doing that too. Meanwhile I’ve been achieving roughly the same result by using this rather excellent post template plugin, which works like using a single page template… Hope that helps in the interim..
If you’re using WP 2.7+ with a 2.7+ compatible theme, each post should be getting a class that includes the category into which it is placed. (e.g. category-uncategorized, category-pictures, category-tutorials, etc.) You can check to see if that is indeed the case by examining your index.php file and looking for <?php post_class(); ?> in the element in which the post is contained (typically a <div> element).
If those things are true, and you’re getting a category-x class for each of your posts, it should be a simple matter of adding the relevant CSS Styles to your stylesheet.
Hope that helps.
Another way I suppose you could do the job would be to use the in_category() method to test whether or not the_post() was in the category you want styled differently, and then output different HTML if that is the case, but it would seem a little excessive to do things that way, particularly as post_class() is already there, and targeting specific CSS styles seems like the faster and more effective option in the long run.
Thread Starter
vi_wp
(@vi_wp)
Thank you all!!!
I’m going to test all that this WE and let you know.
Vivien
Excellent thanks RGlover- I’d not come across that tag- should be very useful.