Help with header link…
On January - 19 - 2010
So if you’ve ever noticed on my site, when I modified the template for my uses I’m unable to click the header to load the homepage anymore. I’m really new to PHP so I can’t figure out how to get that to work.
Here’s the code I’m using in the header to display the image (and the search box):
<div class=”logohead”><?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
Here’s the code for class logohead:
.logohead{
margin: 0px 0 0 0;
padding: 5px 0 0 20px;
width:978px;
height:100px;
background: url(images/logoHEADER3.png)no-repeat;
border:1px solid #fff; }
So that’s it guys. How can I take that code and make it a link to the homepage of my site?






Dani Says:
Something like this should do the trick:
<a href=""><img alt="The Work Is Never Done" height="100px" src="/images/logoHEADER3.png" width="748px" />
You may need to add this to your CSS:
logohead img { margin: 0; padding: 0; }
I’m about to turn in for the evening, but feel free to catch me on Twitter (@daniellenelson) if you have questions.
Posted on January 20th, 2010 at 10:11 PM
Dani Says:
Ah, part of that was lost to the formatting gnomes.
I’ve put it out on a public Google doc here: http://docs.google.com/View?id=dg8b6rnb_78cswmw4dx
and I’ll try to remember to blog about it in the morning.
-Dani
Posted on January 20th, 2010 at 10:13 PM
Brian Says:
Thanks. I had to modify your code a little…leaving the image in my CSS caused it to actually appear twice so I took it out in my CSS. But now my header is a link! Thanks!
I’m also getting an error with my search now (which is the second section of code) and I’m not exactly sure why. Any ideas what I might be getting a divide by zero error? I can show you whatever chunks of code you’d like to see.
Posted on January 20th, 2010 at 10:38 PM
Dani Says:
Hm. Where are you getting the divide by zero error – at page load, or when you run a search?
Posted on January 21st, 2010 at 9:16 AM
Brian Says:
On page load. I’ve reenabled the code that’s causing it to happen. It’s the piece for search.
Posted on January 21st, 2010 at 9:25 AM
Dani Says:
OK – can you email me your header.php file? I’ll take a look.
Posted on January 21st, 2010 at 12:16 PM