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.

Wordpress Homepage Only Links Issue

Discussion in 'HTML & Website Design' started by pcbro34, Dec 19, 2017.

  1. #1
    Hi

    Trying to add a link to my sidebar on wordpress to make it homepage only but cannot get it done. Tried many plugins and custom PHP but the best I can get is the link shows on page 2/page3/page4 etc. Must be homepage only.

    Can anyone help give a PHP code or html code that will ensure the link will remain on the homepage only on the sidebar.

    Thanks
    SEMrush
     
    pcbro34, Dec 19, 2017 IP
    SEMrush
  2. dcristo

    dcristo Illustrious Member

    Messages:
    19,446
    Likes Received:
    1,113
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    9
    #2
    Add this to sidebar.php.

    <?php if(is_front_page()){?>
    place link code here
    <?php }?>
     
    dcristo, Dec 19, 2017 IP