How to remove header from particular single page

I’m a newbie at WordPress and php.
I want to remove the header from one or two pages only.
I saw this http://wordpress.org/support/topic/how-to-remove-footer-from-individual-pages

so I did this in my header.php file found under my theme folder

Read More
     <?php if( !is_page('18') ) :?> <!-- this is what I added -->
     <header class="banner">
     ...rest of html...
     </header>
     <?php endif;?>   <!-- this is what I added -->

Just for the sake of seeing if changes to this file were taking effect I also did <?php if( false ) :?> which was supposed to remove it from all pages but this didn’t work either.

Though I don’t know the difference, I saw some different syntax and so also tried <?php if(false) { ?> and <?php } ?>

I am wondering if I have to do something else to have the changes take effect.

In case it matters, I am using the roots starter theme http://roots.io/starter-theme/
and WordPress 3.9.1

Related posts

Leave a Reply

2 comments

  1. You should be editing the file /roots/templates/header-top-navbar.php. This get decided at base.php:

    if (current_theme_supports('bootstrap-top-navbar')) {
        get_template_part('templates/header-top-navbar');
    } else {
        get_template_part('templates/header');
    }
    

    Just in case, add your code to both. I tested your code with header-top-navbar.php and works ok.