alessio-d
11/23/2017 - 1:24 PM

Last post in the wordpress loop

<?php if (($wp_query->current_post +1) == ($wp_query->post_count)) {
  echo 'This is the last post';
} ?>

<?php if (($wp_query->current_post +1) != ($wp_query->post_count)) {
  echo 'This is the not the last post';
} ?>