Want to add post tag name to body class - I am successful in using the code below to add category to body class -
//adds new body class for post category
add_filter('body_class', 'add_category_class_single');
function add_category_class_single($classes){
global $post;
$category = get_the_category($post->ID);
$slug = $category[0]->slug;
$classes[] = 'post-category-' . $slug;
return $classes;
}
however when i try to use get_the_tags i am not having any luck - any ideas?