Include post tags in body_class
-
Hi,
I’m trying to figure out how to show an individual post’s tags in the body_class.
I can add the post category using
function category_id_class($classes) { global $post; foreach((get_the_category($post->ID)) as $category) $classes[] = $category->category_nicename; return $classes; }
but as yet have been unable to get the coding right to show the tags too.
Any help much appreciated!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Include post tags in body_class’ is closed to new replies.