Hyperlinking your WordPress CSS header image

One question that I’ve been struggling with over the last week is how to make the WordPress header image hyperlink back to the site itself. Many WordPress themes use the CSS background-image properly to display the header image. Unfortunately, there’s no direct way to modify the CSS style sheet to turn the image into a link.

However, there is a way to edit the header.php to do it.

Many themes will have a link that looks like this:

To make your header clickable, replace the above line in the header with this:

Note that this makes the entire header area clickable, not just the image, which may be a subset of the header area.

Thanks to vkaryl on for the basis of this idea.

Also note: if your header.php uses a standard img html tag, just wrap a standard anchor tag around it:


5 comments to Hyperlinking your WordPress CSS header image

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">