fahirsch asked: “How to style posts individually?”

February 4, 2009 at 8:29 am

One of WpRecipes readers, fahirsch, asked in the forum how to be able to style posts individually and add specific backgrounds. Here’s the answser to fahirsch question.

To be able to style posts individually, you have to edit your single.php file and find the line starting with:

<div class="post">

Simply change this line to:

<div class="post" id="post-<?php the_ID(); ?>">

Once you saved the file, you can style an individual post by using the #post-XXX id:

#post-112 { 
    background: #113355; 
    color:#069;
    font-weight:bold;
}

Done! Easy, isn’t it?

Tags: