Home › Forums › Support › blank page template? (no header/footer) This topic has 10 replies, 3 voices, and was last updated 6 years, 9 months ago by Tom. Viewing 11 posts - 1 through 11 (of 11 total) Author Posts July 18, 2017 at 2:50 pm #351378 Ash How do I remove header and footer on certain page? I’d like to make page for iframe. P.S. I saw an example of removing header through hook on documentation, But some how is_page() condition didn’t work. function tu_remove_header(){ if(is_page(111)) remove_action( 'generate_header','generate_construct_header' ); } add_action( 'after_setup_theme','tu_remove_header' ); July 18, 2017 at 3:44 pm #351400 LeoStaff Customer Support Hi there, Can you give this a shot? add_action( 'after_setup_theme','tu_remove_header' ); function tu_remove_header() { if ( is_page( 125 ) ) { remove_action( 'generate_header','generate_construct_header' ); } } July 18, 2017 at 3:48 pm #351401 Ash Isn’t that same as mine? July 18, 2017 at 3:56 pm #351404 LeoStaff Customer Support Hmm looks like you are missing a couple brackets? Can you link us to the page that’s not working? July 18, 2017 at 4:01 pm #351405 Ash Actually bracket didn’t matter. Simply is_page condition does not work. without is_page, it works. July 18, 2017 at 6:55 pm #351435 TomLead Developer Lead Developer is_page() needs to be run a bit later. Try this instead: add_action( 'wp','tu_remove_header' ); function tu_remove_header() { if ( is_page( 125 ) ) { remove_action( 'generate_header','generate_construct_header' ); } } July 18, 2017 at 7:34 pm #351437 Ash Worked! Now how do I remove footer(site-footer div)? July 18, 2017 at 7:42 pm #351440 Ash Found https://generatepress.com/forums/topic/generate-press-copyright-in-footer-bar/ remove_action( 'generate_footer','generate_construct_footer' ); July 18, 2017 at 8:47 pm #351447 LeoStaff Customer Support Try this: add_action( 'wp','tu_remove_footer' ); function tu_remove_footer() { if ( is_page( 125 ) ) { remove_action( 'generate_footer','generate_construct_footer' ); } } July 18, 2017 at 9:11 pm #351454 Ash Yes I did that. I added both remove_action( ‘generate_footer’,’generate_construct_footer’ ); and remove_action( ‘generate_header’,’generate_construct_header’ ); to “wp” action. Thank you. July 19, 2017 at 12:37 am #351501 TomLead Developer Lead Developer Glad you got it working 🙂 Author Posts Viewing 11 posts - 1 through 11 (of 11 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In