I am wanting to create a custom design for indivudual posts on my wordpress.org blog.
Is it possible to modify the indivdual posts css code without affecting any other posts design?
You can do this with categories by creating a new PHP document for the categories ID, but I can’t get this to work with post ID’s.
Any help would be awesome. Thanks.
You can create new post template files for each category? Add this into single.php to conditionally load them:
Then you wouldn’t need tocreate CPTs or condtionally style the body tag. Just simple stand-alone templates for each category, tag etc.
UPDATE:
I found this when digging through the awesome Bones WP theme.
Check out what post_class() does for specific post and category styling.
To answer your exact question, on the post’s body tag is a unique class for THAT post id.
For example http://eyespeak.com/blog/2013/08/friday-favorites-823/
If you inspect the body tag it has the class of
postid-10532
Using that class, you can apply page/post/id/template specific CSS.
This is all done via wordpress’s bodyclass function