Changing Header Image With Custom Header

Some themes like Eleven40 by StudioPress include a custom header image which is built into the theme (hard coded).

It includes images for the header as well as CSS code so its not that easy to change by replacing the header image with a another image the same size.

Update: The new Eleven40 Pro theme is coded differently so here’s the best way to change different images sizes in the header of the Pro version which also works well for other Genesis child themes.

When you add your text title its displayed inside the header image which is something you may want to change.

eleven 40

If you want to add your own custom header image, using any width or height, this tutorial is for you.

This is what the header will look like after it is removed:

Eleven40 Header Removed

We’ll even go one step further and remove the black background from the header wrap area so your header is totally white.

Header Area

Remove CSS Code for Header

Open up your child themes style.css file and search for the CSS code in the header section of the file.

Remove all the code which looks like this:

/* Header
------------------------------------------------------------ */

#title {
background: url(images/logo-texture.png);
border-top: 0;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
display: inline-block;
font-family: 'Oswald', arial, serif;
font-size: 30px;
line-height: 1;
min-height: 33px;
margin: 0;
padding: 18px 25px 17px;
position: relative;
text-shadow: 0 1px #96430d;
}

#title:before {
background: url(images/logo-vert-left.png) repeat-y;
content: "";
display: block;
height: 66px;
left: 0px;
position: absolute;
top: 0px;
width: 7px;
}

#title:after {
background: url(images/logo-vert-right.png) repeat-y;
content: "";
display: block;
height: 66px;
position: absolute;
right: 0px;
top: 0px;
width: 7px;
}

Now that you have removed the default header, you may want to add your own custom header.

You can do this several ways. Here’s 2 of them:

  1. Add support for a custom header using PHP code
  2. Add a custom header image using CSS code.

Add Custom Header Using CSS Code

Simply upload your header image, grab the full url and insert it into this code below before you paste it at the end of your child themes style.css file.

Change the values for the width and height based on your own needs.

#header {
max-width: 1140px;
margin: 0 auto;
width: 100%;
height: 200px;
background: url("replace-wth-full-image-url") no-repeat scroll 0 0 transparent;
}

Remove Header Background Image

You can also remove the black background image from the header wrap by modifying this code also.

Inspect the background element using Firebug and copy the code to your child themes style.css file.

Or find the code in your child themes style.css file under the Wrap section and change it.

You can add the new rule at the end of the file with the new declaration.

/* Wrap
------------------------------------------------------------ */

#wrap {
	background: url(images/bg.png) repeat-x;
}

Change the code to something like this if you want a totally white background:

/* Wrap
------------------------------------------------------------ */

#wrap {
	background: #fff;
}

You could change the background image if you wanted but make sure not to completely remove this code or will will cause problems with other elements on your site.

Remove Header Completely

You can remove your header image entirely from your site or on specific pages only.

The only problem with using this method is that you also remove the header right widget area and other elements which you may be better off keeping.

Displaying Different Header Images & Sizes On Specific Pages

1. You can add a custom header image on your home page and use another on the rest of your site even its its a different height or
2. You can display custom header images on your category archive pages which are different to the rest of your website.

Now that you’ve got this far, you should be fairly familiar with the CSS code which is used to display and style your header images so you can add or style your custom header images without any major problems.


Comments

18 responses to “Changing Header Image With Custom Header”

  1. Hi Brad,
    At first thanks a lot for this awesome post.
    Following your instruction I have removed my black colored default header and made a custom menu in white color,til now its fine. But when saw my left widget area i found it was increased and the right one was decreased it means it erased my left and right margin………..Please sit help me to fix it as before but not with header.
    Thank you.

    1. Brad Dalton Avatar
      Brad Dalton

      What theme are you using? Most don’t include a header left widget.

  2. You don’t know how much I want to reach through this computer and kiss you! This actually worked! I don’t know what other people have been doing I haven’t been able to figure this one out. I know once i get used to Genesis, I’ll love it, but it is a learning curve for me.

    One thing…how do you center the logo? Nothing I’m doing is working for me.

    1. Brad Dalton Avatar
      Brad Dalton

      hahaha!

      Yes its a bit of a learning curve Erin but nowhere near as steep as many other themes require for customization.

      Please post your question on the forum as it depends on how you have added your logo to your site.

  3. Now that I am using a custom image it doesn’t center when the responsive setting in the theme kicks in. Any ideas how to make the image center above the black nav bar when on a phone/tablet?

    I’m developing on a localhost so can’t share a URL… sorry.

    1. Brad Dalton Avatar
      Brad Dalton

      This requires knowledge of writing CSS code for mobile responsiveness.

      I did notice that the Genesis 2.0 resizes the header images perfectly so there’s been big improvements in responsiveness.

  4. Hi Brad

    I just tried to delete the css code for header and am unable to save it – getting this message “You need to make this file writable before you can save your changes. See the Codex for more information.” Any idea on why? I went to codex and didn’t really explain it..

    Cheers
    Kim

    1. Brad Dalton Avatar
      Brad Dalton

      Hi Kim

      Seems like a permissions problem on your files which some hosts create by default for security reasons.

      You can easily change the permissions so they are writeable.

  5. Joseph Avatar

    For some reason this doesn’t work for me. I followed the directions exactly but I get a distorted image as follows:
    http://i.imgur.com/10MlyoJ.png

    Do you know what’s going on?

    1. Brad Dalton Avatar
      Brad Dalton

      Hi Joseph

      The tutorial focuses on removing the default header entirely and replacing it with support for a custom header.

      Looks like you haven’t removed all the code to remove the entire header.

  6. Robert DelRossi Avatar
    Robert DelRossi

    Brad — As a newbie I wrestled with this a good long time, too, but your instructions finally got me over the hump. Thank you!

    For what it’s worth, what had me confused was that I had text stored in Appearance->Theme->Customize (my site name and tagline). When I followed your instructions to remove the CSS code for #title, #title:before and #title:after, that Site Name from the Customize area appeared n screen. I couldn’t figure out why the header wasn’t disappearing as you said it should.

    Bottom line, clearing the Site Title from from Appearance->Theme->Customize got everything working right.

    Naturally, in hindsight, I don’t know how I missed it!

    Anyhow, thank you again for your effort in steering us in the right direction.

    — Robert

    1. Brad Dalton Avatar
      Brad Dalton

      No worries Robert and thanks for the feedback.

  7. Juanfer Avatar
    Juanfer

    Thank you very much, Brad. I had been struggling for 2 hours with this issue till I found your instructions. Then, 5 minutes work and my custom logo is up and running.

    Much appreciated.

    1. Brad Dalton Avatar
      Brad Dalton

      No worries Juanfer.

  8. Just had to give you a big THANK YOU for taking the time to detail these instructions. I swear, I deal with header stuff on this theme only once or twice a year and always forget how it works. You saved me a ton of time and got me dialed in on my wife’s foodie blog.

    Thank you thank you THANK YOU!!!

    1. Brad Dalton Avatar
      Brad Dalton

      No worries Ryan. Thanks for the nice comment.

  9. I had to come back and thank you for these very clear instructions. Did my first CSS coding today and even though it’s phase one of how I want the blog to look, I’m very pleased. Thank you very much for posting this. lifeinrealthyme.com

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.