deepak-rajpal
8/10/2015 - 3:50 PM

WordPess identify last post in the loop, Tested Code

WordPess identify last post in the loop, Tested Code

<?php
/* If you want to change the last post on each page: 
   http://return-true.com/change-the-last-post-in-the-loop-in-wordpress/
*/
  if(($wp_query->current_post + 1) == $wp_query->post_count) {
    //Whatever you want to occur should this be the last post of the current page
  }
?>