Sticky Posts - Different Background Color


Author Message
Rudi

Posted: 4/12/2014
Quote message 

Hi,

I have a good WordPress Artisteer 4.1 Theme for my website, but I would like to add a feature where a Sticky Post has a different background color, to make it stand out (because it was made Sticky)... in my case I would like a white background for Sticky Posts but the normal background for the other Posts.

My websitte is at www.rugby-talk.com

Can anyone help me with the coding for it, please.
 
jrgweb

Posted: 4/12/2014
Quote message 

@Rudi - All post should have an "id". For example: Chiefs vs Melbourne Rebels – Live Game Article has an "article id" of id="post-80270".

So try and do something like this:
#post-80270.art-post {background:white !important;}

The results:

 
Rudi

Posted: 4/12/2014
Quote message 

jrgweb,

Thanks a stack so far... but just help me out here...

Where do I enter that code, in which file?
 
Rudi

Posted: 4/12/2014
Quote message 

jrgweb,

Figured it out... put it in the style.css file,, right at the top (under the initial text commnets)... and it works!

Now for some or other permanent way to change a Sticky Post's background... in other words, when you make it Sticky, that background appears!
 
Rudi

Posted: 4/12/2014
Quote message 

OK, I have devised a permanent fix myself.

Here is how you do it:

In the style.css file, go add the following, just after the initial text and credits to Artisteer

/* Making a Sticky Post with a Different Background Color */
.sticky {
background:white !important;
}

The rest of the style.css file now follows, like normal.

Of course you could use different colors or a hex code for your background color (Hex Code eg. #FFFFFF)