Created
October 29, 2011 23:50
-
-
Save billerickson/1325264 to your computer and use it in GitHub Desktop.
Custom Body Classes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom Body Classes | |
* @link http://www.billerickson.net/wordpress-class-body-tag/ | |
* @author Bill Erickson | |
* | |
* @param array $classes existing body classes | |
* @return array modified body classes | |
*/ | |
function my_body_classes( $classes ) { | |
if ( is_home() ) | |
$classes[] = "home"; | |
if ( is_category() ) | |
$classes[] = "category"; | |
return $classes; | |
} | |
add_filter( 'body_class', 'my_body_classes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment