Hide Header Footer Per Page
- سُلَيْمَان بْن دَاوُوْد

- Nov 24, 2022
- 1 min read

Selection of Pages Settings to Hide the header and footer so we can accumulate the page ids of pages to hide
add_action( 'wp_footer', 'landing_pages' ,9999 );
function landing_pages(){
?>
<script type="text/javascript">
jQuery(document).ready(function() {
<?php
$pages = get_field('select_landing_pages','option');
if($pages){
foreach( $pages as $page ){
$hidepageids[] = $page->ID;
}
}
if( in_array(get_queried_object_id(), $hidepageids ) ){
?>
jQuery('.site-header,.site-footer').css({'display':'none'});
<?php
}
?>
});
</script>
<?php
}
Comments