Forums

How to create a styleheet for only a specific post (8 posts)

  1. 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

  2. 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.

  3. 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

  4. 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.

  5. rcdunnii
    Member
    Posted 3 years ago #

    I'll try that approach - thanks!

  6. spiritbased
    Member
    Posted 3 years ago #

    You could use the WP Post Styling plugin?

  7. 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;)

  8. jbjweb
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic