• Resolved JCornford

    (@jcornford)


    I’d like to only display my header image on the home page, is this possible? I’m guessing I just need to remove the bit of code that references it on all of the other pages/posts, but I don’t know what I am looking for.

    I am using the theme f8lite

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey.

    Sorry I have no answer for you! But I need a solution to this problem too!

    Another issue which concerns me in maybe creating a bit more difficulty in solving this problem is that I am using a static page as my home page, so I’m not sure how you could code it so that one page(the home page) has a header and the rest don’t.

    I think the logic would be something like: “If page is Home, then display header, else don’t display header”

    But I just don’t know how to implement that and where and what else it effects since I’m editing an existing theme. (Delicate by NattyWP).

    Hey JConford,

    I found a solution.

    You can implement this by adding the is_home() check in your header.php file.

    for example:

    <?php if(is_home) { ?>
    
      <div class="head-img">
      ...
      </div>
      <!-- END Header -->
    
    <?php } ?>

    So in essence, you’re just wrapping the if statement around your current header image. it might not be class = “head-img” for you.
    If you are using a static page as your home page, then change (is_home) for (is_page(‘nameofpage’))

    Hope that helps.

    Regards.
    Preet

    Hello, I am new to wordpress and I am using the Delicate theme. I believe I am having the same problem as jcornford, I want my custom logo to show on all pages but I only want my header image to show on my home/ landing page. I tried the code from Preet996 and it didn’t work for me. Any help would be appreciated, thank you!

    best wishes

    blacke

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I only want a header image on the homepage’ is closed to new replies.