// Función para agregar el slug de la taxonomía como clase CSS al cuerpo del post function add_taxonomy_slug_as_css_class() { global $post; if (is_single() && has_term('', 'SLUG CATEGORIA', $post)) { $terms = get_the_terms($post, 'SLUG CATEGORIA'); if ($terms && !is_wp_error($terms)) { foreach ($terms as $term) { $slug = $term->slug; echo ''; } } } } add_action('wp_footer', 'add_taxonomy_slug_as_css_class');