Created
June 11, 2024 04:16
-
-
Save wplit/0531cfdbef6523d645bd45c84a8b0c73 to your computer and use it in GitHub Desktop.
prevent Bricks' header/footer being rendered based on condition
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 | |
/* do not render header if acf_hide_header field is true */ | |
add_filter('bricks/render_header', function( $header_html ) { | |
return is_singular() && get_field('acf_hide_header') ? '' : $header_html; | |
}); | |
/* do not render footer if acf_hide_footer field is true */ | |
add_filter('bricks/render_footer', function( $footer_html ) { | |
return is_singular() && get_field('acf_hide_footer') ? '' : $footer_html; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment