1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need help

Discussion in 'WordPress' started by silent_1, Jul 2, 2013.

  1. #1
    I want to place links on home page of my wp blog. Is it possible to place them on HP so that they don't appear on any other page. As if I place them in sidebars or at the bottom they appear on every page.

    thanks.
     
    silent_1, Jul 2, 2013 IP
  2. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
  3. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #3
    Put this code in the desired file (sidebar.php or footer.php). It should show the link only if you are displaying the homepage.

    <?php
    if ( is_home() ) {
        echo '<a href="http://example.com">Example</a>';
    }
    ?>
    Code (markup):
    Next time please don't PM me, just ask here.
     
    Devtard, Jul 3, 2013 IP
  4. silent_1

    silent_1 Well-Known Member

    Messages:
    427
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    155
    #4
    Thank you so much. :)
     
    silent_1, Jul 3, 2013 IP