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
<?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
You should be editing the file
/roots/templates/header-top-navbar.php
. This get decided atbase.php
:Just in case, add your code to both. I tested your code with
header-top-navbar.php
and works ok.you are giving wrong condition it should be if(is_page(’18’))
{// do nothing } else {…rest of html…}