Add custom taxonomies as class names to an archive page of custom post types
The function you mention is going to return a list of links — aren’t you just trying to get the term slug as a class? Why not do…. $terms = get_the_terms($post->ID, ‘my-category’); $more_terms = get_the_terms($post->ID, ‘another-category’); $slug_out = array(); foreach($terms as $term){ $slug_out[] = $term->slug; } foreach($more_terms as $term){ $slug_out[] = $term->slug; } echo ‘<div … Read more