Created
July 11, 2016 23:44
-
-
Save mor10/68a5235ff24cac23442d8ae20e2c1d21 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
thanks! just what I needed :D