Last active
May 19, 2017 12:13
-
-
Save srikat/e8d6f1d69740ab132352 to your computer and use it in GitHub Desktop.
Add 'inner' body class to all inner pages in WordPress.
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
add_filter( 'body_class', 'sk_body_class' ); | |
/** | |
* Add "inner" class to 'body' element for inner pages | |
* i.e., for all pages other than site's homepage/front page. | |
* | |
* @author Sridhar Katakam | |
* @link https://sridharkatakam.com/add-inner-body-class-inner-pages-wordpress/ | |
*/ | |
function sk_body_class( $classes ) { | |
if ( ! is_front_page() ) { | |
$classes[] = 'inner'; | |
} | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment