wordpress snippets last updated   : April 14, 2014
we now have 630 snippets

Setup whitelist body_class to remove unwanted classes

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you create a white-list of terms to include in body_class. This is a great way to filter out many of the unwanted classes added

snippet :  PHPcopy
add_filter('body_class', 'wps_body_class', 10, 2);
function wps_body_class($wp_classes, $extra_classes)
{
    // List of classes allowed
    $whitelist = array('portfolio', 'home', 'error404');
    $wp_classes = array_intersect($wp_classes, $whitelist);
    return array_merge($wp_classes, (array) $extra_classes);
}
source →
jqsnipp.com | we just launched jquery snippets website