Styling Recent Post

Posted on April 27th, 2011

Loop:

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

$currentdate = date(‘Y-m-d’,mktime(0,0,0,date(‘m’),date(‘d’),date(‘Y’)));

$postdate = get_the_time(‘Y-m-d’);

if ($postdate == $currentdate) {

echo ‘<div>’;

} else {

echo ‘<div>’;

} ?>

<a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a>

</div>

<?php endwhile; endif; ?>

Style:

.post{
        /* styles for all posts */
        }
.post.new {
        /* styles for new posts */
        }