Hi,
I am creating a custom template. The front page has a 'recent news' section that requires the recent posts to be floated and therefore I need to be able to add a custom class to each of them (I can't use their id's as they will change as the posts get updated).
My current loop code is below with the class news_post. I think the solution would be adding a duplicate loop that will show the next most recent story (everything else I have tried has resulted in a duplicate post).
<!-- begin news loop -->
<h1>Latest News</h1>
<?php query_posts('cat=3&showposts=2'); ?>
<?php while (have_posts()) : the_post();
if( $post->ID == $do_not_duplicate ) continue; ?>
<div class="news_post" id="post-<?php the_ID(); ?>">
<h2><?php if (strlen($post->post_title) > 20) { echo substr(the_title($before = '', $after = '', FALSE), 0, 20) . '...';} else {the_title();} ?></h2>
<?php global $more; $more = 0; the_excerpt('Read more...'); ?>
</div>
<?php endwhile; ?>
<!-- end news loop -->
Any help would be great