カスタム投稿
<?php $terms = wp_get_object_terms($post->ID,'〇〇_taxonomy');foreach($terms as $term){echo '' . $term->slug . '付けたいclass名';}?>
固定ページ(通常投稿)
<?php $cat = get_the_category();$cat = $cat[0]; { echo '<div class="' . $cat->category_nicename . '-cat" />' .get_cat_name($cat->term_id).'</div>'; } ?>