updated   : May 15, 2012
we now have 588 snippets
By : , on December 01, 2011 9:00 am

Conditionally display content on last post

wordpress snippet

Adding this snippet within the loop of your wordpress theme will let you display something only if it is on the last posts.

snippet :  PHPcopy
<?php if( ($wp_query->current_post + 1) < ($wp_query->post_count) ) { ?>
   <b>last post</b>
<?php } ?>
source →