Suggestiong for body_class to inlcude blog ID
-
Dear WP users
I would like to propose that WordPress includes
<body>
tag classblog-<blog_id>
on network installations when one callsbody_class()
function.I am currently adding it via my theme, but I think it would make sense for the class to be added by default, allowing pages/posts templates differentiation from one blog to the next. This is what I do for those interested,
// Add specific CSS class by filter add_filter( 'body_class', 'network_blog_id_class_name' ); function network_blog_id_class_name( $classes ) { $blogID = get_current_blog_id(; $classes[] = 'blog-'.$blogID; return $classes; }
I have also toyed with the idea of putting an extra attribute into the
<body>
tag with the id of the current blog,<body blog="1" class="blog-1....">
this would allow one to leverage the CSS3 attribute selectors.
Any thoughts?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Suggestiong for body_class to inlcude blog ID’ is closed to new replies.