Style wordpress posts individually

February 4, 2009 · Print This Article

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-xxx {
background: #113355;
color:#069;
font-weight:bold;
}


Your choice for site templates and wordpress themes

Comments

Got something to say?

You must be logged in to post a comment.