Output terms to post_class()
The easiest and most straight-forward way to do this would be: $tax_terms = get_the_terms( $post->ID, array(‘genre’) ); $tax_terms = wp_list_pluck($tax_terms,’slug’); post_class(implode(‘ ‘,$tax_terms)); You could also apply a filter to post_class that does essentially the same. function tax_classes_wpse_105386($classes) { global $post; $tax_terms = get_the_terms( $post->ID, array(‘genre’) ); $tax_terms = wp_list_pluck($tax_terms,’slug’); $classes = array_merge($classes,$tax_terms); return $classes; } … Read more