• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Add Custom Header To Home Page Only In Genesis

If you want to display a unique header image on the front page of your site which is different to what your other pages display, you’ll find one of the best solutions in this post.

1. First step is to remove support for a custom header if your child theme includes PHP code like this in your functions.php file:

//* Add support for custom header
add_theme_support( 'custom-header', array(
	'width'           => 1140,
	'height'          => 350,
	'header-selector' => '.site-title a',
	'header-text'     => false
) );

Different themes use different code however if your theme includes a function named add_theme_support(‘custom_header’), please remove it.

Note: You can leave the above code in some themes like the Genesis Sample theme and use it for your default header which displays on all pages excluding your home page and skip the 2nd step. Others will require you to remove it and use the code in the next step.

2. The 2nd step is to copy the following PHP code and paste it at the end of your child themes functions.php file.

Note: Both solutions require you to add this code as instructed.

Register for full access

Related Tutorials

  • Add Unique Header Image To Custom Landing Page Template for Genesis

Reader Interactions

Comments

  1. Adam Abrams says

    August 19, 2014 at 7:11 am

    Hi Brad! I’m a “moderately” experienced WordPress guy who’s trying to wrap his head around Genesis and it’s going well so far, but I’ve run into a real snag here. I’m wondering if you can tell me why my method (not quite as advanced as yours) isn’t working.

    I’ve removed the genesis_do_header action and replaced it with an alternative, as per your solution, but I’m trying simply to use some “if” logic in my alternate action. But it doesn’t work… and I’m wondering if there’s some special Genesis reason why.

    My code is here:

    https://gist.github.com/cosmocanuck/3b023045715f1be29738

    …but my homepage refuses to look any different.

    The key action is my if statement in lines 15-19. Is that kind of statement not allowed here?

    Hoping you can shine a little light on this one if you have a chance. Thanks!

    Adam

    Log in to Reply
    • Brad Dalton says

      August 19, 2014 at 7:25 am

      Hello Adam

      Your code is nothing like what i’ve coded here.

      I would need to spend some time testing it.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.