Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('body_class', 'blacklist_body_class', 20, 2);
- function blacklist_body_class($wp_classes, $extra_classes) {
- if( is_single() ) :
- // Filter the body classes, and remove 'singular' when single post
- if (!in_array('singular', $wp_classes)) : continue;
- else:
- foreach($wp_classes as $key => $value) {
- if ($value == 'singular') unset($wp_classes[$key]);
- }
- endif;
- endif; // Add the extra classes back untouched
- return array_merge($wp_classes, (array) $extra_classes);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement