1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Linking Logo to Homepage

Discussion in 'WordPress' started by calum, May 4, 2009.

  1. #1
    Hey

    I have a blog at www.thenewwebmaster.com - if you visit it that you can see the main logo at the top isn't linked to the homepage.

    How can I make it go to the homepage? It could be a normal HTML link but it can't because the image is CSS.

    The logo is just:

    <div id="header">
    
    	  <div id="header-right">
    	  <?php include 'adsense/468x60.php';?>
    	  </div>
    	  <div style="clear: both;"></div>
    </div>
    
    HTML:
    So, as you can see it has no link in it.

    The CSS code for the header is this:

    #header {
    width: 950px;
    margin-left: auto;
    margin-right: auto;
    height: 172px;
    background-image: url(images/logo.jpg);
    background-position: top left;
    background-repeat: no-repeat;
    }
    HTML:
    As you can see, it has the logo as a background image. My question is how can I make it link to the homepage so when I click it, it goes to the homepage.

    Calum
     
    calum, May 4, 2009 IP
  2. indyainfo

    indyainfo Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In any wordpress blog the logo is by default linked to the index.php, although we can change it from the settings option, you can check there if you find anything helpful.

    Best Regards
     
    indyainfo, May 4, 2009 IP
  3. calum

    calum Peon

    Messages:
    2,821
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    0
    #3
    There is nothing in the blog settings, I think my logo is linked differently as it is in CSS.
     
    calum, May 4, 2009 IP
  4. mizaks

    mizaks Well-Known Member

    Messages:
    2,066
    Likes Received:
    126
    Best Answers:
    0
    Trophy Points:
    135
    #4
    Try something like this:

    
    <div id="header" onclick="location.href='<?php echo get_settings('home'); ?>';" style="cursor: pointer;">
    <div id="header-right"><?php include 'adsense/468x60.php';?></div>
    <div style="clear: both;"></div>
    </div>
    
    Code (markup):
     
    mizaks, May 4, 2009 IP
    calum and cchetanonline like this.
  5. calum

    calum Peon

    Messages:
    2,821
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks so much, that worked perfectly :) +rep left.
     
    calum, May 4, 2009 IP