Quickly replace the header image in the default WordPress 2.7 Kubrick theme

David Nash General, wordpress 4 Comments

I was asked to do some quick mods to client’s WordPress blog. He wanted to replace the banner image. He’s using WordPress 2.7 and has the default Kubrick theme.

This isn’t as easy as you would think as it’s generated by PHP so that the colours can be dynamically set.

Here’s what I did:

  1. Download wp-content/themes/default/images/kubrickheader.jpg
  2. Modify it, save and upload as wp-content/themes/default/images/kubrickheader_NEW.jpg
  3. Edit wp-content/themes/default/header.php. On line 42 you should see <div id=”headerimg”>
  4. Modify this so it reads:

<div id="headerimg" style="background: url(<?php bloginfo('stylesheet_directory'); ?>/images/kubrickheader_NEW.jpg) no-repeat -1px 0">

Upload header.php and it should now be using your new header. I used the “-1px 0” because the header was out of horizontal¬† alignment by 1 pixel. I don’t know if that’s because of the header image he sent or if that’s the way WordPress’s dynamic banner image works. You might need to remove that part.

This probably isn’t the best way to do it but it’s a quick and easy solution.

Comments 4

  1. David,

    How do I upload as wp-content/themes/default/images/kubrickheader_NEW.jpg? I have he .jpg photo I want to use, I just can’t seem to figure out where/how to upload the photo in the word press directory.

    Thanks for your help!

    1. Hi Adrian, how did you install WordPress?

      I did it via FTP – so when I look at the files on my web server I go into the wp-content/themes/default/images/ directory and put kubrickheader_NEW.jpg there.

      If WordPress was installed for you automatically, you might need to talk to your web host about getting access to the files.

  2. Once I got my domain I just installed WordPress so I guess it was an automatic installed. I will ping the support at the web host provider. Thanks again!

  3. Greаt wеb site. Plеnty of helpful info here.
    I’m sending it to several buddies ans additionally sharing in delicious. And certainly, thanks on your sweat!

Leave a Reply

Your email address will not be published. Required fields are marked *