1

I have a Template Monster WP theme that I need to remove the headers from all pages except home. I have read several posts on this, but my code is a bit different. Can someone please help me? The header.php file is below. Many thanks!

<div id="main"><!-- this encompasses the entire Web site -->
    <header id="header">
        <div class="container_12 clearfix">
            <div class="grid_12">
        <div class="logo">
          <?php if(of_get_option('logo_type') == 'text_logo'){?>
            <?php if( is_front_page() || is_home() || is_404() ) { ?>
              <h1><a href="<?php bloginfo('url'); ?>/" title="<?php 
               bloginfo('description'); ?>"><?php bloginfo('name'); ?></a></h1>
            <?php } else { ?>
2
  • In general, you should be asking questions of this type on your specific theme's help forum.
    – mrwweb
    Commented May 1, 2012 at 4:05
  • Your header.php should really be called on every page - it can display differently (or not output at all) - but it really should also be calling functions like wp_head() on every page. Commented May 1, 2012 at 10:07

1 Answer 1

2

In the line before <header id="header">, put this code:

<?php if( is_home() ) : ?>

After the </header> tag that closes #header (which isn't included in your code), put this code:

<?php endif; ?>

The is_home() is called a "template tag" and there are quite a few of them. If your site uses a static front page set on Settings > Reading, then replace is_home() with is_front_page().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.