Make WordPress Custom Header Image A Link
Changing the WordPress default header image is a pretty easy. Simply upload a different header to the themes Images folder, Change the name of the old header image to something else and then change the new header image to the name of the current header image.
Well it sounds simple enough huh? Well not so fast. There a few things to consider, like the size of the new image. Make sure it fits and looks well proportioned on your WordPress blog. But all that will be for another post. This is kind of backwards but after you change your header image it will usually cover the name of your blog that is linked to main blog’s URL and now there is now way for your visitors to click it to get back to the main blog page.
The fix is quite simple on the WordPress default theme. Open the themes header.php file. and look for the following code near the bottom.
<div id=”page”>
<div id=”header”>
<div id=”headerimg”>
<h1><a href=”<?php echo get_option(’home’); ?>/”><?php bloginfo(’name’); ?></a></h1>
<div class=”description”><?php
Now add the following code between the page and header id and change the red URL to your blogs URL.
<div class=”header” onclick=”location.href=’http://www.Your Blogs URL Here.com‘;”
style=”cursor: pointer;”></div>
The code should look like this:
<div id=”page”>
<div class=”header” onclick=”location.href=’http://www.Your Blogs URL Here.com’;”
style=”cursor: pointer;”></div>
<div id=”header”>
<div id=”headerimg”>
<h1><a href=”<?php echo get_option(’home’); ?>/”><?php bloginfo(’name’); ?></a></h1>
Now your whole WordPress header image will be linked to your main blog’s URL or the blog’s home page.
Customize WordPress WordPressIf you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!










