-
-
Save joshfitzgerald/8c2216568300c8ca72f707b5b8cde4f8 to your computer and use it in GitHub Desktop.
Custom page template with no sidebar for Twenty Sixteen child theme
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 | |
/** | |
* Adds custom classes to the array of body classes. | |
* | |
* @param array $classes Classes for the body element. | |
* @return array (Maybe) filtered body classes. | |
*/ | |
function wpcampus_body_classes( $classes ) { | |
// Adds a class of no-sidebar to custom no-sidebar page template. | |
if ( is_page_template('page-no-sidebar.php') ) { | |
$classes[] = 'no-sidebar'; | |
} | |
return $classes; | |
} | |
add_filter( 'body_class', 'wpcampus_body_classes' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment