Highlight your Sticky Posts
Apr 9th, 2009 by Johnny
To simply highlight something you can just modify your CSS stylesheet styles.css to include something like this:
.highlight { background-color: #FFFF00; } |
With WordPress v2.7, you can now mark a post as “Sticky”, which puts it at the top of the page. If you are using a WordPress 2.7 compatible theme, then it should work right out of the box. However, for older themes, you need to make a few simple modifications to your theme template and stylesheet.
In your template index.php file,
| change: | <div class="post" id=... > |
||
| to: | <div <?php post_class(); ?> id=... > |
Add this to your template styles.css file:
.style { background-color: #FFFF00; } |
Now any posts that is checked as “Stick this post to the front page” will be highlighted and moved to the top of the front page.

NOTE: you must be using WordPress 2.7 or newer to have this feature.