Header.php

Discussion in 'WordPress' started by Earl Sargent, Dec 1, 2013.

  1. #1
    Hey guys, I am trying to make the navigation bar disappear on the homepage of the site. How do I edit the PHP file for the homepage. The template for the homepage is a custom template and I have tried <div id="masthead" style="display:none;"></div> in the custom template.php folder, but it is not disappearing. Thanks.
     
    Earl Sargent, Dec 1, 2013 IP
  2. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    406
    Best Answers:
    21
    Trophy Points:
    295
    #2
    Got a link? Should not really stick that code inline per say either.

    Nigel
     
    Nigel Lew, Dec 1, 2013 IP
  3. Earl Sargent

    Earl Sargent Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    A link to the site? Or would you like to see the PHP?
     
    Earl Sargent, Dec 1, 2013 IP
  4. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #4
    I would use something like this:

    <?php if (!is_front_page()){ ?>
    
    <div id="masthead">this won't be displayed on the homepage</div>
    
    <?php
    }
    ?>
    
    Code (markup):
     
    Devtard, Dec 2, 2013 IP
  5. sara malik

    sara malik Member

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #5
    It would be better if can share the Link of your website
     
    sara malik, Dec 7, 2013 IP
  6. rhinocl

    rhinocl Member

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #6
    Get the class for the page. You should see it near the top in firebug
    Then assuming it is page 24 add this to style.css
    .page-id-24 #masthead{display:none;}
     
    rhinocl, Dec 9, 2013 IP