wordpress snippets last updated   : January 29, 2015
we now have 646 snippets

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 →

Did you like this post? If so please share it with your friends. Thanks!