top of page

Hide Header Footer Per Page

  • Writer: سُلَيْمَان بْن دَاوُوْد
    سُلَيْمَان بْن دَاوُوْد
  • 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 
}


 
 
 

Recent Posts

See All
Duplicate Category in Wordpress

The following code helps to duplicate the default wordpress category by help of code. // Add Duplicate option for categories in WordPress...

 
 
 
C#.NET and Its Associated Codes

1- Creating an Desktop Application in C#.NET C# ADO.NET & MySQL MAIN C# and MySQL ADO.NET with Crystals Reports Ready Code 2- Handling...

 
 
 

Comments


© 2020 by syednazrulhassan

bottom of page