Only homepage links

Discussion in 'WordPress' started by cuteboy, Jan 15, 2011.

  1. #1
    Looking for plugins which can help me in placing link only on home page.
    I want to place some links only on homepage side bar and not in inner pages...
     
    cuteboy, Jan 15, 2011 IP
  2. ajivets

    ajivets Member

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    you can search with context widget. it's very simple. you can make some option to show the ads link just a minute
     
    ajivets, Jan 15, 2011 IP
  3. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Use the Widget Logic plugin, which gives every widget an extra control field called "Widget logic" that lets you control the pages that the widget will appear on. The text field lets you use WP's Conditional Tags, or any general PHP code.

    Using that plugin, you would enter is_home() into the text box to display your widget only on the home page.
     
    Dodger, Jan 15, 2011 IP
  4. deluxdon

    deluxdon Catch Me If You Can...!!!™ Staff

    Messages:
    25,481
    Likes Received:
    1,943
    Best Answers:
    32
    Trophy Points:
    480
    #4
    Use below given code where you want to use only homepage links in a sidebar.php

    <?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>
    [B]Your links here[/B]
    <?php } ?>
    Code (markup):
    DON.
     
    deluxdon, Jan 15, 2011 IP
  5. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #5
    And what if you do not have a sidebar.php in your theme?
     
    Dodger, Jan 15, 2011 IP
  6. deluxdon

    deluxdon Catch Me If You Can...!!!™ Staff

    Messages:
    25,481
    Likes Received:
    1,943
    Best Answers:
    32
    Trophy Points:
    480
    #6
    You can add it in index.php in that case.

    DON.
     
    deluxdon, Jan 15, 2011 IP
  7. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Let me rephrase that.

    Some child themes do not have a sidebar.php. I understand that you can "call" the sidebar from any template file.

    I also had a concern of just slopping in a conditional statement followed by a blanket "your links here" as you suggested. Since the OP was asking for a plugin, then suggesting the person just start editing his sidebar.php without any warnings of what that may do, is kind of reckless IMO.
     
    Dodger, Jan 15, 2011 IP