Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 { ?>
share|improve this question
    
In general, you should be asking questions of this type on your specific theme's help forum. –  mrwweb May 1 '12 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. –  Stephen Harris May 1 '12 at 10:07
add comment

1 Answer

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().

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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