Many themes have a nice header image or logo yet rely on a button to link to the home page. If you’re like me, you prefer to simply click the logo to get to the index page. Whether you are working with an existing image or you added your own, adding the link is a simple task in WordPress. The following even works if the image is set in the background…
Go to ‘Theme Editor‘ under the ‘Design‘ tab in WordPress version 2.5.1
Go to ‘Header (header.php)‘ in the ‘Theme Files‘.
Find:
<div id=”header”>
Replace with:
<div id="header" onclick="location.href='<?php bloginfo('url');?>';" style="cursor:pointer;">
Note: If there are any other attributes to the Header division <div> tag just insert the added (in red ) attribute and style elements.
Caution: As always, back-up your files before trying any of these tips or making any changes.
Hint: Copy and paste code to notepad to strip any HTML formatting. Then cut and paste to your editor.
Related posts: