WordPress.org

Ready to get started?Download WordPress

Forums

How to Only Show Header Image on Home Page? (14 posts)

  1. kernmedia
    Member
    Posted 1 year ago #

    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; ?>
  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

  3. Tara
    Member
    Posted 1 year ago #

    Try adding this before your code:

    <?php if(is_home) { ?>

  4. kernmedia
    Member
    Posted 1 year ago #

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

  5. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    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 } ?>
  6. kernmedia
    Member
    Posted 1 year ago #

    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!

  7. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    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

  8. kernmedia
    Member
    Posted 1 year ago #

    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!

  9. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    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.

  10. Rainer007
    Member
    Posted 1 year ago #

    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

  11. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    @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

  12. tcbuell
    Member
    Posted 1 year ago #

    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

  13. Amesuniversal
    Member
    Posted 8 months ago #

    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?

  14. WPyogi
    Volunteer Moderator
    Posted 8 months ago #

    @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:

    http://cyberchimps.com/forum/free/

Topic Closed

This topic has been closed to new replies.

About this Topic