Homepage only Link ?

Discussion in 'WordPress' started by MeetHere, Jul 13, 2007.

  1. #1
    Can anybody guide me on adding a "homepage only" link on my wordpress blog ?

    Is there any php code ? :eek:

    Thanks in advance.
     
    MeetHere, Jul 13, 2007 IP
  2. F.L.A.W.L.E.S.S

    F.L.A.W.L.E.S.S Banned

    Messages:
    113
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Me think U got to add it like how you edit your website like using Frontpage.

    Pardon me if i'm wrong

    FL
     
    F.L.A.W.L.E.S.S, Jul 13, 2007 IP
  3. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #3
    yes you are wrong.
    This is not html.. Its a php coding.
     
    MeetHere, Jul 13, 2007 IP
  4. Edynas

    Edynas Peon

    Messages:
    796
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You need to use conditional tags. In your case is_home

    See http://codex.wordpress.org/Conditional_Tags


    
    if (is_home())
    {
         echo '<a href=http://www.link.com>link</a>';
    }
    
    Code (markup):
    But this hardcoded and you need to go into code to change it. An other way is to have a category in your links that you manage thru wp-admin. and use instead of the echo the line <?php wp_get_links(category); ?>
     
    Edynas, Jul 13, 2007 IP
    MeetHere likes this.
  5. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #5
    I tried those conditional tags thing before - but i did mistake in coding.

    Thanks, its working now. :)
    Rep added.
     
    MeetHere, Jul 13, 2007 IP
  6. Edynas

    Edynas Peon

    Messages:
    796
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks for the rep. Glad I could help and that it's working for you
     
    Edynas, Jul 13, 2007 IP