The Work Is Never Done

Help with header link…

Posted by Brian 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?

Both comments and pings are currently closed.

6 Responses

  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

About me.

In these pages you will find the amassed wisdom of a mid-twenties tech-nerd. I’m almost as passionate about technology as I am about Jesus Christ and my family. When I’m not working as technical director of Rock Bridge Community Church I’m either hanging out with my family or sleeping. This is basically my space to word vomit and share how we do tech at Rock Bridge. Sometimes it’ll be exciting, sometimes it’ll be lame. I make no promises for consistent quality (or any quality for that matter.) Hopefully it’ll be fun and I’ll update it enough to make it worth your while. Peace out.