functions.phpに下記を追加します。
function isFirst(){
global $wp_query;
return ($wp_query->current_post === 0);
}
function isLast(){
global $wp_query;
return ($wp_query->current_post+1 === $wp_query->post_count);
}
利用方法
ループ中に記述します。
<?php isFirst() { ?>
ループの最初の処理のときに表示したい内容
<?php } ?>
<?php isLast() { ?>
ループの最後の処理のときに表示したい内容
<?php } ?>


