free hit counters
If you are using Internet Explorer as your browser please be running at least IE 7 or above. This site does not support IE 6 or below. Go here for the latest free version including easy download and installation instructions If you want to make it real easy on yourself, download Firefox , the most popular browser in the world. It's free and simple. You'll be so glad you did.
May
18
2009

The easiest way to add a “clickable” header image

I wrote an earlier tutorial about showing the easiest way to add a header image HERE.  I had a lot of feedback saying that it wasn’t clickable. That’s absolutely correct because it isn’t. That tutorial shows how to add a header image and that’s it. It never said anything about being clickable.

The following tutorial, in my opinion, is the easiest way to add a clickable header image….

First, make sure your image is in your custom.css file…

Next, in your custom_functions.php file, create a simple function and assign it a div tag with a unique name so you can style the header area in your custom.css…

function myheader() {?>
<div class=”myheader-space”></div>
}

Next, add the image to the function with the complete file path to the image and give it a class name so you can style the image size in your custom.css…

function myheader() {?>
<div class=”myheader-space”><img class=”myheader” src=”http://www.my site.com/wp-content/themes/thesis/custom/images/headerimage.jpg”/></div>
}

Next, wrap the image with the link to where you want the header image to click to…

function myheader() {?>
<div class=”myheader-space”><a href=”http://www.where I want it to go.com”><img class=”myheader” src=”http://www.hedonism-inc.com/wp-content/themes/thesis/custom/images/headerimage.jpg”/></a></div>
}

Finally, remove the default header and replace it with your new one…

function myheader() {?
<div class="myheader-space"><a href="http://www.where I want it to go.com"><img class="myheader" src="http://www.my-site.com/wp-content/themes/thesis/custom/images/headerimage.jpg"/></a>>/div>
<?
}
remove_action(’thesis_hook_header’,'thesis_default_header’);
add_action(’thesis_hook_header’,'myheader’);

Leaving a comment with code in it...

If you would like to leave a comment and you have examples of code you want to show, you must "escape the code". This allows the entire code to show correctly by inserting certain variable around certain tags to make them show. If you don't "escape the code" your code will show up broken, mangled, and it won't be able to be seen correctly. "Escaping the code" is very simple...

  1. Copy your code you want to show
  2. Click here to go to the site to escape the code
  3. Follow the directions, it's so easy
  4. Once you have the escaped code copied, paste it in the comments area where you want
  5. Now you can enjoy life


Go ahead, leave a comment...

Leave a Comment

Previous post: Change the color of the tagline in the header

Next post: Remove comments are closed statement