Skip to content

Instantly share code, notes, and snippets.

@samediamba
Forked from billerickson/gist:1325264
Last active August 29, 2015 14:17
Show Gist options
  • Save samediamba/ac6521c829d443491d06 to your computer and use it in GitHub Desktop.
Save samediamba/ac6521c829d443491d06 to your computer and use it in GitHub Desktop.
<?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