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.

How To Place Only Homepage Link In Wordpress

Discussion in 'WordPress' started by dilpearl, Feb 6, 2013.

  1. #1
    I want to try place external links in homepage. But i can't do this. For this i use widget logic plugin. But problem is that link also show in the older entries pages but i want to link show only homepage.

    Check this site: http://www.weightlosssolutionstips.com/
    Where i place link under weight loss plan section but this link also show in the older entries pages. But i want its show only homepage.

    Please give me any idea how to put links in the homepage only in wordpress.
     
    dilpearl, Feb 6, 2013 IP
  2. ArchAxis

    ArchAxis Well-Known Member

    Messages:
    136
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    125
    #2
    Wrap the link in the is_home() function.

    <?php
    if ( is_home() ) {
        // This is a homepage
    } else {
        // This is not a homepage
    }
    ?>
    PHP:
    See http://codex.wordpress.org/Function_Reference/is_home
     
    ArchAxis, Feb 6, 2013 IP
    b4db0y likes this.
  3. b4db0y

    b4db0y Notable Member

    Messages:
    3,523
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    205
    #3
    b4db0y, Feb 24, 2013 IP
  4. thefizboshow

    thefizboshow Active Member

    Messages:
    102
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    50
  5. Masim man

    Masim man Active Member

    Messages:
    73
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    58
    #5
    I don't know if it possible to do, I'd like to know as well.

    I use is_home() conditional tag for Dynamic menu highlighting in my theme, it also applied to the older entries pages.

    But if you set a static page as homepage, it's quite easy to achieve by using custom template with custom sidebar.
     
    Masim man, Feb 27, 2013 IP
  6. ArchAxis

    ArchAxis Well-Known Member

    Messages:
    136
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    125
    #6
    @thefizboshow you'll want to install this plugin http://wordpress.org/extend/plugins/widget-logic-visual/ it will visually allow you to set if conditions on any Widget without coding.

    Be sure to read and watch the installation instructions for Widget Logic and you'll understand how to use it.
     
    ArchAxis, Feb 27, 2013 IP
    thefizboshow likes this.
  7. thefizboshow

    thefizboshow Active Member

    Messages:
    102
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    50
    #7
    Works like a charm, thank You!
     
    thefizboshow, Feb 28, 2013 IP
  8. uyasar

    uyasar Well-Known Member

    Messages:
    131
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #8
    i suggest wp-insert plugin. Awesome
     
    uyasar, Jun 5, 2013 IP