how to add links in just home page

Discussion in 'WordPress' started by Salman Qamar, Jan 29, 2011.

  1. #1
    i want to offer link exchange on my wp blog.
    i want that links are only shown on homepage only.
    is there any plugin t o do this?
    or how to do this manually?
     
    Salman Qamar, Jan 29, 2011 IP
  2. BFiggy

    BFiggy Member

    Messages:
    89
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    25
    #2
    If the link exchange is on the sidebar just create another sidebar (same as sidebar.php but without the link exchange) and name is something like "sidebar2".

    Then in the index.php call for the "sidebar2" by using something like

    <?php require('sidebar2.php') ?>
    PHP:
     
    BFiggy, Jan 29, 2011 IP
  3. bambangw

    bambangw Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Edit sidebar.php or footer.php place where you put a link blogroll.

    Add PHP code to display the blogroll links.

    PHP code to display the blogroll in general:

    <? php get_links_list ();?>

    Views from the links above will be down sequentially in alphabetical order. In order to further save space, then the blogroll links can be separated by a slash symbol (|). You can use the following code:

    <? php get_links (-1,'', '|', '-');?>

    You can even customize their own form of a blogroll that is displayed, such as placing it in the pulldown window. What is clear you no longer need to manually add the link when there is someone who invites you to exchange links. Just add their link through the admin panel.

    This tip is only valid for self hosted wordpress. Hopefully useful.
     
    bambangw, Jan 30, 2011 IP
  4. Salman Qamar

    Salman Qamar Active Member

    Messages:
    240
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    i want that it is viewable only at homepage?
     
    Salman Qamar, Jan 30, 2011 IP
  5. Salman Qamar

    Salman Qamar Active Member

    Messages:
    240
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #5
    no body for help?
     
    Salman Qamar, Feb 1, 2011 IP
  6. BFiggy

    BFiggy Member

    Messages:
    89
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    25
    #6
    Where are you trying to put the links on the homepage... on the sidebar, footer, etc? Did you try the way I explained above?
     
    BFiggy, Feb 1, 2011 IP
  7. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Where ever it is put, use a conditional:

    
    if (  is_home() || is_frontpage() ) {
       /* Insert your linking code here */
    }
    
    Code (markup):
     
    Dodger, Feb 1, 2011 IP