Making Header Image clickable
-
Hello,
I’m using an image in order to display the blog title. So because there is no clickable text in the header which redirects you to the blog mainpage, I’d like to make the whole header-image clickable.
I was adding this to my header.php, but appearantly it doesn’t work:
<div id="headerimg"onclick="location.href='https://www.mydomain.com';" style="cursor: pointer;" title="Home"></div>
my header.php looks like this now:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile="https://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <meta name="verify-v1" content="s/PrC06nimhhimtebXxjLQet/RwXNUuuK+rkz2j0VuQ=" /> <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/ie-styles.css" /> <![endif]--> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_head(); ?> </head> <body> <div id="wrapper"> <!-- wrapper starts --> <div id="header"> <!-- header starts --> <div id="headerimg"onclick="location.href='https://www.mydomain.com';" style="cursor: pointer;" title="Home"></div> </div> <!-- header ends -->
What am I missing? Anyone got an idea?
Greetings
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Making Header Image clickable’ is closed to new replies.