View Full Version : make the blog title a hyperlink on all pages including home

04-28-2011, 05:03 AM
Hi there

I would like to make my blog title a link on my home page just like it is on all the others...

how can i modify this code... ?

<div class="im-header">
<div id="header" <?php if(!is_home()) { echo 'onclick="location.href=\''; bloginfo('url'); echo '\';" style="cursor: pointer;"'; } ?> >
<!-- jc 5/12/2010 - changes for hyperlinking blog title -->
<?php if (empty($header)) { ?>
<div class="titleText socshadow" style="margin-bottom:-5px; font-weight:bold;"><h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1></div>
<div class="descText socshadow"><?php bloginfo('description'); ?></div>
<?php } else { ?>
<div class="titleText socshadow" style="margin-bottom:-5px; font-weight:bold;"><h1><?php if(!is_home()) { ?><a href="<?php bloginfo('url'); ?>"><?php } ?><?php echo stripslashes($header['titleText']); ?><?php if(!is_home()) { ?></a><?php } ?></h1></div>
<div class="descText socshadow"><?php echo stripslashes($header['descText']); ?></div>
<!-- end jc -->
<?php } ?>
</div><!-- /header -->

Thank you in advance!

04-28-2011, 05:25 AM
The title is a link to the home page. It does not make sense to link to the page you're on.

04-28-2011, 06:36 AM
Can anyone help alter this code. I do need the link to be active on the home page as well.

04-28-2011, 06:37 AM
Where do you want it to link to?

Dan Nickerson
04-28-2011, 09:28 AM
Out of curiousity, can you let us know why you need this? It's most unusual.

Many times when we know the reason for a request we can suggest alternative solutions.

05-02-2011, 04:37 PM
My SEO consultant requested it. As that is the keyword that I want my home page to rank for and apparently this will help. For me to put another one in would not look right...

Dan Nickerson
05-02-2011, 06:26 PM
The h1 text should be all that matters from an SEO standpoint. I'm not an seo expert, but I've never heard of there being value in a link to a page on that page.