Need help on coding

Discussion in 'HTML & Website Design' started by pablopabla, Sep 22, 2008.

  1. #1
    I have a wordpress blog.

    If I wish to place an outbound link on the sidebar and this outbound link only shows on the homepage (instead of sitewide), what is the code that I need to paste on the sidebar.php file?

    Thanks.
     
    pablopabla, Sep 22, 2008 IP
  2. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #2
    Use this:

    
    <?php
    if(is_home()) {
         echo 'your link here';
    }
    ?>
    PHP:
     
    Clive, Sep 22, 2008 IP
  3. ClickMedia

    ClickMedia Banned

    Messages:
    104
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Is there any thing like is_post() , that to identify the post. I know we can use is_page() to check page.
     
    ClickMedia, Sep 22, 2008 IP
  4. pablopabla

    pablopabla Active Member

    Messages:
    608
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Thanks for the code. It helps.
     
    pablopabla, Sep 22, 2008 IP
  5. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #5
    You're welcome, pablopabla :)
     
    Clive, Sep 23, 2008 IP