Support » Fixing WordPress » How to Only Show Header Image on Home Page?

  • kernmedia

    (@sixstringsoul)


    Hey Everyone, I’m using the MesoColumn theme, and it has a feature to add a header image. I only want it to show on the home page, however. Can anyone tell me how to modify this code in the header.php file to achieve that?

    <?php if( get_header_image() ): ?>
    <div id="custom-img-header"><img src="<?php echo header_image(); ?>" alt="" /></div>
    <?php endif; ?>
Viewing 13 replies - 1 through 13 (of 13 total)
  • Moderator t-p

    (@t-p)

    Try adding this before your code:

    <?php if(is_home) { ?>

    kernmedia

    (@sixstringsoul)

    Thanks, Tara. Unfortunately that didn’t work. My homepage just turned to a white screen. Any other suggestions?

    Moderator cubecolour

    (@numeeja)

    ɹoʇɐɹǝpoɯ

    you got a white screen as it also needs a terminating curly brace

    This should work

    <?php if(is_home) { ?>
    <?php if( get_header_image() ): ?>
    <div id="custom-img-header"><img src="<?php echo header_image(); ?>" alt="" /></div>
    <?php endif; ?>
    <?php } ?>

    kernmedia

    (@sixstringsoul)

    That worked, thanks cubecolour. I ended up switching themes, though. Now I can’t figure out how to style my sub-menu the same as the main/top menu. Could you have a look? Hover over “Free Advice” at http://www.naturalhealthyfamilies.com/. Thanks!

    Moderator cubecolour

    (@numeeja)

    ɹoʇɐɹǝpoɯ

    I had a quick look for you, however we don’t normally support commercial (which includes ‘click to pay’) themes here.

    From the number of stylesheets & embedded css fragments being loaded, it looks as if there is an options panel to change the appearance somewhere in your WordPress admin. If this is the case, there might be something in there you can change, but as I don’t have an installed copy of the theme I have no idea what you would change and trying to untangle it in a browser is not something I’d be inclined to do for fun.

    You should ask the theme author for support or choose a theme from http://wordpress.org/themes/ instead

    kernmedia

    (@sixstringsoul)

    Thanks, cubecolour. No worries, man. I appreciate the input so far. I did actually pull the theme (EvoLve) from the WordPress site (listed here: http://wordpress.org/themes/browse/popular/). The theme does have a GUI to control some of the design elements (part of why I chose it), but there’s nothing to change the sub-menus (only tools for changing main menus). I’ll see if the developer can offer any insight. Thanks!

    Moderator cubecolour

    (@numeeja)

    ɹoʇɐɹǝpoɯ

    Aha! I saw the themes url listed in the stylesheet & went to that site where it looked like it could only be downloaded in exchange for a plug on social media. I think I should have searched on WordPress.org as well for the theme name, so apologies for that.

    In that case it is supported here & has its own forum at http://wordpress.org/support/theme/evolve

    If you post there, either the author or someone who has experience of using/customising the theme should see it. I might be able to download it & have a look if I have some time later.

    Hi,
    This is my first post.
    I am using MesoColumn and keep getting the words “Archive For” in front of the Category Heading Banner of Post I select and I want to get rid of them as in this image:

    Does anyone know how to do this?
    Thank you

    @rainer007 – you’ll need to ask the developer of your theme – as commercial themes aren’t supported on these forums.

    For general WP questions, please start your own thread next time –
    http://codex.wordpress.org/Forum_Welcome#Where_To_Post

    I still can’t get the header image on the home page only. I am in twenty twelve and I have set up a child theme. I tried adding the above code to the style.css in the child theme but the image still appears on every page. Here is one of my inner pages:
    http://tcbuell.com/?page_id=34
    I want to remove the header image from all but the home page so I can have images on the inner pages.
    Am I missing something?
    Thanks – Tom

    I am using the Cyberchimps Fine free theme and I need the code and area in the footer.php in which to place it…any help?

    @amesuniversal – you need to start your own thread – this one is long outdated and you are using a different theme. The best place for help with the theme you are using will be on the developers’ forums here:

    Free Forum ( Limited Support for Non-Plus Members )

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to Only Show Header Image on Home Page?’ is closed to new replies.