How to add a “last” class to the last post in loop.php?

assuming you’re using post_class():

add_filter('post_class', function($classes){
  global $wp_query;

  if(($wp_query->current_post + 1) == $wp_query->post_count)
    $classes[] = 'last';

  return $classes;
});

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)