例:タームリスト
<?php
$taxonomies = get_post_taxonomies();
$terms = wp_get_object_terms( $post->ID, $taxonomies );
if( !empty( $terms ) ){
$no = 0;
$last = count( $terms ) - 1;
foreach( $terms as $term ){
switch ($no++) {
case 0:
echo 'first-'.$term->slug;
break;
case $last;
echo ' last-'.$term->slug;
break;
default:
echo ' middle-'.$term->slug;
break;
}
}
}
?>