Cleanup Body_Class

Currently, when I use body_class() it generates a bunch of crap that I don’t need. What I’d like to do is have the following:

homepage: class='blog page-home'
single:   class='blog page-single'
author:   class='blog page-author'
category  class='blog page-category'

Should I even use an add_filter for body_class? Or just create my own function?

Related posts

Leave a Reply

1 comment

  1. You can use the body class filter to add, edit, remove classes from the body class. Here’s what the function will look like:

    function edit_body_classes($classes) {
        // Add conditionals here...
    
        return $classes;
    }
    add_filter('body_class', 'edit_body_classes');
    

    Looks like there’s plenty of Documentation in The Codex