How to make the link homepage only?

Discussion in 'Link Development' started by harikumar, Sep 18, 2009.

  1. #1
    Hi DPers,

    Can somebody help me by telling how to add a link in my site such that it must appear only in the home page and not in all of the sub pages?

    Eg; If i add a link google.com in my site http://itsmylyf.com.

    The link google.com must appear only in the home page and not in sub pages like

    http://itsmylyf.com/about
    http://itsmylyf.com/post1

    Please help.

    To Mods: I hope this is the right section to discuss about this. If it is not please remove this. Thanks.
     
    harikumar, Sep 18, 2009 IP
  2. Brian1970

    Brian1970 Notable Member

    Messages:
    2,886
    Likes Received:
    416
    Best Answers:
    1
    Trophy Points:
    290
    #2
    Brian1970, Sep 18, 2009 IP
  3. xwishmasterx

    xwishmasterx Peon

    Messages:
    141
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    what blogscript are you using? Also, where is this link located? In the sidebar, footer etc? It shouldn't be to hard to do :)
     
    xwishmasterx, Sep 18, 2009 IP
  4. SFNUM8

    SFNUM8 Active Member

    Messages:
    297
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #4
    The easiest thing to do is put the link in the context of the homepage and not in one of the sidebars.
     
    SFNUM8, Sep 18, 2009 IP
  5. harikumar

    harikumar Member

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #5
    @ Xwishmaster
    I'm using wordpress blog. The link is placed in sidebar. Is it possible to make one link in my blog to make as site wide and another as homepage only?

    @SFNUM8

    Mate, couldn't understand that. What do you mean by context of the homepage?
     
    harikumar, Sep 18, 2009 IP
  6. crystite

    crystite Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Since you're using wordpress, you can add a text widget that will have your link. Add some code to show your link conditionally. For eg. If you want it on your home page only, you'd put

    <?php if (is_home()) { ?> <type your link here> <?php } ?>

    You might also need to get the exec-php plugin to get this to work. I can't remember for sure now if you actually need it.

    Another option you can explore is checking out the conditional widget plugin. I have it but have never actually used it.

    Crystite
     
    Last edited: Sep 18, 2009
    crystite, Sep 18, 2009 IP
  7. Nystul

    Nystul Well-Known Member

    Messages:
    3,077
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    175
    #7
    <?php if (is_home()) { ?>
    
    Homepage Links Only
    
    <?php } ?>
    Code (markup):
     
    Nystul, Sep 18, 2009 IP
  8. harikumar

    harikumar Member

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #8
    @Crystite & Nystul

    Thanks mate. I think this code will help me. I have just used this method to make the link homepage only.
    can you tell me how can i confirm whether the link is only in homepage only?
     
    harikumar, Sep 19, 2009 IP
  9. Phooey

    Phooey Active Member

    Messages:
    413
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    80
    #9
    Visit another page and see if it is still there. If it isn't, it's working. ;)
     
    Phooey, Sep 19, 2009 IP