Add Tags to Body Class CSS

0.0/5
<?php
function tags_to_body_class( $classes ) {
    global $post;
    $posttags = get_the_tags( $post->ID );

    if ( $posttags ){
        foreach( $posttags as $tag )
            $tags[] = $tag->slug;
        return $tags;
	}
}
  
add_filter('body_class', 'tags_to_body_class');

Comments and reviews

{{ reviewsTotal }} Review
{{ reviewsTotal }} Reviews
{{ options.labels.newReviewButton }}
{{ userData.canReview.message }}

Description

This snippet was fetched automatically from WPDistro.cz projects.

Author

Tags

This snippet is untagged