I'm attempting to do an if/else-statement on my small Wordpress-template. However i can't appear to select the best element.

I wan't it to search for the most recent publish around the blog. I already added a script that give a class of .first towards the latest publish.

What im attempting to do in dummy-php-language:

<?php
if ( class is .first) { do something to .first}
else () { do something to everything else }
?>

i have looked within the wordpress-documentation. However i can't appear to locate something that will choose "latest publish"...

Thanks

Jonas

A simple solution is always to have a count from the publish you are at, and make a move whether it's the very first. Within the index.php, within the have_posts() loop:

<?php if (have_posts()) : $count = 0; ?>
    <?php while (have_posts()) : the_post(); $count++; ?>
        <?php if($count ==1) ?>
            // do something to first
        <?php else ?>
            // do something to everything else
        <?php endif; ?>              
    <?php endwhile; else: ?>
<?php endif; ?>