A Simple Way to Make Your WordPress Banner Clickable – Surry Hills, NSW, Australia
I wanted to make the banner/header on my site clickable in order to allow visitors the ability to see the original picture. After googling for a while, I found a simple method using only php at WordPress support. On my theme, you must edit the header.php file which contains the banner/header image details.
I added the following code to the div that is responsible for the banner/header image:
onclick=”location.href=’http://www.headerlink.com’;” style=”cursor: pointer;
The relevant portion of the header.php file for the WordPress header I use is in blue:
<body>
<div id=”farouter”>
<div id=”outer”>
<div id=”rap”>
<div id=”masthead” onclick=”location.href=’http://bohemianslikemaggie.com/modules/gallery2/main.php?g2_itemId=1950′;” style=”cursor: pointer;”>
<h1 id=”header”><a href=”<?php bloginfo(‘url’); ?>”><?php bloginfo(‘name’); ?></a></h1>
<h2 id=”tagline”><?php bloginfo(‘description’); ?></h2>
</div>
<div id=”hmenu”>
<div id=”hnav”>
<ul id=”navlist”>
<li class=”page_item”><a href=”<?php bloginfo(‘url’); ?>”>Home</a></li>
<?php wp_list_pages(‘depth=1&title_li=’); ?>
</ul>
</div>
</div>
<div id=”main”>
<div id=”content”>
<!– end header –>
