Making the most recent post stand out
Hey gang, I’m hoping one of you PHP gurus will be able to give me a little assistance. On my website (pshero.com) I use a series of custom fields to create summaries of each of my posts like this:
‘<?php while ( have_posts() ) : the_post() ?>
<!– GET ARTICLE_IMAGE CUSTOM FIELD –>
<?php //get article_image (custom field) ?>
<?php $image = get_post_meta($post->ID, ‘article_image’, true); ?>
“><img src=”<?php echo $image; ?>” alt=”<?php the_title(); ?>” />
<?php the_category(‘,’) ?> // <?php comments_popup_link(‘0’, ‘1’, ‘%’); ?>
<?php //get article_summary (custom field) ?>
<?php $summary = get_post_meta($post->ID, ‘article_summary’, true); ?>
<?php echo $summary; ?>
</div><!– /#article_preview –>
<!– .post –>
<?php comments_template() ?>
<?php endwhile; ?>’
But what I want to do is find a way to style only the most recent post (on the homepage only) differently than the rest. I’ve scoured the net and found several snippets of code that in theory should do the trick, but they all end up breaking the page completely.
I’m sure there are others out there with the same wish, so any help would be greatly appreciated!
Thanks in advance.
- The topic ‘Making the most recent post stand out’ is closed to new replies.