Code for Widget

Discussion in 'WordPress' started by gossiplover23, Aug 23, 2011.

  1. #1
    Hey! I have a link in my Wordpress sidebar widget that needs to appear on the Homepage only. Does anyone know how to make it so it doesn't show up on all of the other pages?

    Any help would be appreciated!
     
    gossiplover23, Aug 23, 2011 IP
  2. liberox

    liberox Member

    Messages:
    107
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #2
    Just insert this lines into your sidebar.php (or similar file) in your Theme folder in desired position:

    <?php if(is_home()) { ?>
    <p> <a href="http://what-you-want.com">What-You-Want</a></p>

    <?php } else { ?> <?php } ?>
     
    liberox, Aug 24, 2011 IP