« Add your WordPress blog RSS feed to your Facebook page | Home
Make your WordPress header image clickable and guarantee it will load
By braddock | June 6, 2008
I was having loads of problems with the theme on a new blog. The header image only loaded about 50% of the time. It might load on the main page, but when you went to another page or read a post the header would disappear.
I searched and found quite a few tips for getting my header to load. It seems the header is the last thing to load on any page, so making the page load faster was the main recommendation. The usual answer was to make sure my HTML validated. I did that but the header still loaded sporadically.
The header format could be the problem (my header was being called from my CSS style sheet by the way). So I adjusted the size of my header several times, and even changed it from a jpg to a png. This didn’t work either.
At the same time I was trying to troubleshoot my header loading issue I also wanted to make the header a clickable link to the home page. The two issues had one solution. I changed the way my WordPress theme called the header image. Here’s the code that did the job for me:
<div class=”header”><a href=”<?php echo get_settings(’home’); ?>”><img src=”<?php bloginfo(’template_url’); ?>/img/header.jpg” border=”0″ alt=”<?php bloginfo(’name’); ?>” /></a></div>
This turned the header call and link into a PHP function. The only thing you have to tweak is the URL to your header image in your theme’s directory. My header loads every time now, and it adds to the usability of my blog as a link back to the home page.
Related posts:
Topics: WordPress |





