How do I add a class to <body> that is generated by <?php body_class(); ?>>

I need to add a class of “two-sidebars” to the regular bunch of WP classes that are generated by <?php body_class(); ?>>

The reason I need to do this is I’m integrating WP into a Drupal install, and need to keep the “two-sidebars” class for style reasons for the Drupal part of the page.

Read More

What’s the best way? jQuery? Is it possible to hook into body_class?

Related posts

Leave a Reply

2 comments

  1. You can add to the function simply by placing the desired class as the first parameter like so body_class('class-name').

    If you’d like a little more flexibility you can hook into it using add_filter('body_class','my_class_names').

    You can read more here.