rcdunnii
Member
Posted 3 years ago #
Can I link or embed a style for only a specific posting at my site. If I add the style info to style.css via the Theme Design editor it is site-wide. I'd like to avoid a jillion inline style= declarations... in the post itself...
Probably a beginner's question - any info greatly appreciated!
Bob
blueshift9
Member
Posted 3 years ago #
Basically you need to find out how this specific post is uniquely identified and create a CSS selector targeting just that post. Lets say the id for the post is something like "post-20" you need to target that one unique id.
rcdunnii
Member
Posted 3 years ago #
Thanks blueshift9 - would you mind explaining further please? Would the selector be an id or class in the stylesheet.css?. Thanks in advance
bob
blueshift9
Member
Posted 3 years ago #
It depends, you'll need to take a look at your generated source in order to figure it out, not the stylesheet.
rcdunnii
Member
Posted 3 years ago #
I'll try that approach - thanks!
spiritbased
Member
Posted 3 years ago #
You could use the WP Post Styling plugin?
patrickrhill
Member
Posted 3 years ago #
I think the easiest way is to open the page in your browser that has that post on it. Then in firefox, go to view page source and you will see the post id. Use that as your selector in your style sheet and only that post will be affected. For instance to change the color for a post with id="post-234", the css would be: #post-234 {background-color: red;)