Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tigredanky/a1e5d925428532e9d0d95eec8881b3ce to your computer and use it in GitHub Desktop.
Save tigredanky/a1e5d925428532e9d0d95eec8881b3ce to your computer and use it in GitHub Desktop.
WordPress Functions.php | Add Body Class By Page Template
<?
// BODY CLASS FOR NOLOGO PAGE TEMPLATE
add_filter( 'body_class','nologo_body_class' );
function nologo_body_class( $classes ) {
if ( is_page_template( array( 'page-nologo.php', 'page-empathology.php', 'page-resilience-reboot.php' ) ) ) {
$classes[] = 'nologo';
}
// add body class for course module
if ( is_page_template( array( 'page-empathology.php', 'page-empathology-v2.php' ) ) ) {
$classes[] = 'course-module';
}
// add body class for course module
if ( is_page_template( array( 'page-template-footer-only.php'/* , 'page-empathology-v2.php', 'page-prosperity-pattern.php', 'page-soul-speak.php' */ ) ) ) {
$classes[] = 'footer-only';
}
return $classes;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment