Last active
December 13, 2022 14:22
-
-
Save nicmare/3354ce2d634022ca5372d123394c4fca to your computer and use it in GitHub Desktop.
checks if header and/or footer is disabled on page and adds a body class
This file contains hidden or 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 | |
function add_blocksy_bodyclasses($classes){ | |
if($blocksy = get_post_meta(get_the_ID(),"blocksy_post_meta_options",true)){ | |
if(isset($blocksy["disable_header"]) && $blocksy["disable_header"] == "yes") | |
$classes[] = "blocksy-header-disabled"; | |
if(isset($blocksy["disable_footer"]) && $blocksy["disable_footer"] == "yes") | |
$classes[] = "blocksy-footer-disabled"; | |
} | |
return $classes; | |
} | |
add_filter('body_class','add_blocksy_bodyclasses'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment