Return to Snippet

Revision: 18739
at October 6, 2009 19:48 by joelhaus


Initial Code
// Add my-custom-class to body tag

function custom_body_class($classes) {
	$classes[] = 'my-custom-class';
	return $classes;
}
add_filter('thesis_body_classes', 'custom_body_class');

// To single pages only

function custom_body_class($classes) {
 if (is_single()) {
	$classes[] = 'my-custom-class';
	return $classes;
 }
}
add_filter('thesis_body_classes', 'custom_body_class');

Initial URL
http://codesnippets.joyent.com/posts/show/2304

Initial Description
Function to add custom body class in th Thesis theme for WordPress...Thanks to @girliegeek!

Initial Title
Add Custom Body Class to WP Thesis

Initial Tags
css, class, php, wordpress, filter

Initial Language
PHP