Show some Blogroll links on home page only in WP?

Discussion in 'WordPress' started by jg123, Mar 10, 2007.

  1. #1
    Is there a plugin for this or a fix if you want to show certain blogroll links on the home page only?

    thanks
     
    jg123, Mar 10, 2007 IP
  2. DarrenC

    DarrenC Peon

    Messages:
    3,386
    Likes Received:
    154
    Best Answers:
    0
    Trophy Points:
    0
    #2
    DarrenC, Mar 10, 2007 IP
    JohnScott likes this.
  3. duilen

    duilen Active Member

    Messages:
    354
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #3
    I would just hard code some conditional code into sidebar.php rather than looking for a plugin.

    I believe this should work on 1.5+

    sidebar.php

    Replace:
    
    <?php get_links_list(); ?>
    
    Code (markup):
    With:
    
    <?php if(is_home()){ get_links_list(); } ?>
    
    Code (markup):
     
    duilen, Mar 11, 2007 IP
  4. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #4
    I am not much of a coder, could you please explain the code you mentioned a little more? Where would the links go and could I have some showing on the home page only and some showing site-wide?

    thanks
     
    jg123, Mar 11, 2007 IP
  5. duilen

    duilen Active Member

    Messages:
    354
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #5
    Is your blog hosted by Wordpress? If so then I don't believe you would have access to sidebar.php from within your theme folder.

    <?php [COLOR="SeaGreen"]if(is_home()){[/COLOR] [COLOR="Red"]get_links_list();[/COLOR] [COLOR="SeaGreen"]}[/COLOR] ?>
    Code (markup):
    The green part of the code checks to see if you are on the homepage. If so the red code used to display the blogroll is executed. is_home() is a built in Wordpress function.

    Adding a blogroll unique to each category or page is possible but it would take quite a bit more work. I have a few ideas which I will test before showing the code. I think I may code a plugin for this.
     
    duilen, Mar 11, 2007 IP
  6. Edynas

    Edynas Peon

    Messages:
    796
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #6
    you say some links...do you mean your total links only on the homepage or fi 10 out of 29 on the homepage and on the others al links
     
    Edynas, Mar 11, 2007 IP
  7. Edynas

    Edynas Peon

    Messages:
    796
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #7
    sorry hit post to early.
    If you want to display only a part of your links on the homepage what you can do is make 2 groups in the linkmanager. First grou place it in category 1 and the others in category 2 next place the folowing code on your sidebar
    <?php if(is_home()) { ?>
    <div class="sidebox">
    <ul>
    <?php get_links_list(1);
    </ul>
    </div>
    <?php }else{ ?>
    <div class="sidebox">
    <ul>
    <?php
    get_links_list(2);
    }
    ?>
     
    Edynas, Mar 11, 2007 IP
  8. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #8
    So I can do it by creating 2 different categories, do I have to put a category name or something in the code you provided to make it work?
     
    jg123, Mar 11, 2007 IP
  9. bentong

    bentong Banned

    Messages:
    3,543
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You may also try this condition to display only on the homepage.

    if ( (is_home()) && !(is_page()) && !(is_single()) && !(is_search()) && !(is_archive()) && !(is_author()) && !(is_category())  )
    PHP:
     
    bentong, Mar 11, 2007 IP
  10. Cheap SEO Services

    Cheap SEO Services <------DoFollow Backlinks

    Messages:
    16,664
    Likes Received:
    1,318
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Seeing there are some wordpress coders here I was wondering if any of you know how to get this? The older version of WP allowed you to choose how many posts on the front page or how many days on the front page. The new versions only allow how many posts.

    Any help here will be appreciated.

    Col :)
     
    Cheap SEO Services, Mar 11, 2007 IP
  11. duilen

    duilen Active Member

    Messages:
    354
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #11
    Why would you want to display a # of days rather than a # of posts? I always thought it was annoying when you don't post for a week or two and suddenly you have no content on the homepage.

    I guess this could be used as a motivational tool to make sure you keep pumping out content. Other than that its not very practical.
     
    duilen, Mar 11, 2007 IP
  12. Edynas

    Edynas Peon

    Messages:
    796
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #12
    It´s either the category name or the id
     
    Edynas, Mar 12, 2007 IP
  13. fsmedia

    fsmedia Prominent Member

    Messages:
    5,163
    Likes Received:
    262
    Best Answers:
    0
    Trophy Points:
    390
    #13
    fsmedia, Mar 12, 2007 IP
  14. Edynas

    Edynas Peon

    Messages:
    796
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Can be done I think...the get links tag is able to get besides the links also the timestamp, ratings etc etc. It also has a parameter for echo.

    <?php get_links(category, 'before', 'after',
    'between', show_images, 'order', 
    show_description,show_rating, limit, 
    show_updated, echo); ?> 
    PHP:
    so if you put echo at 0 it wil not display it but retrn a array. That array you can modify and display after your function. My guess is that you can get the value of show updated to do what you want.
    Have´t tried it but it should point you in a direction that might work.
     
    Edynas, Mar 12, 2007 IP