Having one blogroll category show on home page only

Discussion in 'WordPress' started by jg123, Oct 20, 2007.

  1. #1
    I have not been able to find the answer to this one on Wordpress.org, you know how you can create different categories for blogroll? I would like one of those categories to show only on the home page. I had someone here help me with a code snipet to show an item in the sidebar of the home page only but I can't figure out how to get that code to work for a seperate category.

    If it is not possible I would be ok with someone showing me how to just hard-code it to show on the home page only and look like another category, with the title ect.

    thanks for anyone that can help
     
    jg123, Oct 20, 2007 IP
  2. evossman

    evossman Peon

    Messages:
    450
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If i understand what you're saying this might help. Try this.

    You can use the get_links tag described in this part of the codex

    http://codex.wordpress.org/Template_Tags/get_links

    There's a lot of parameters to tweak the look of the links and order, etc etc. But the first parameter controls the category ID. Just put in the blogroll category ID you'd like found in your manage categories section.

    something like <? php get_links(2) ?>

    Then put that code where you want the links to appear on your homepage theme file usually index.php, or if you have a seperate sidebar, wherever that code is needed on your sidebar, etc etc.

    Hope that helps.
     
    evossman, Oct 20, 2007 IP
  3. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #3
    Ah, so what you are saying is to just call the second set of links on the home page, but I don't think I would be able to configure this myself :-( I was hoping there was an easier way to do it within the script itself or with minimal coding.
     
    jg123, Oct 20, 2007 IP
  4. evossman

    evossman Peon

    Messages:
    450
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #4
    do you mean minimal coding without adjusting the theme? cause if you would like to just adjust the theme, go to theme editor, go to your index.php file, if it calls sidebar.php then go to sidebar.php, once you have the spot you want the code copy and paste

    <? php get_links(your blogroll ID#) ?>
     
    evossman, Oct 20, 2007 IP
  5. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #5
    But if I do it in the sidebar.php then everytime I call the sidbar it will have all the blogroll links in it.
     
    jg123, Oct 20, 2007 IP
  6. evossman

    evossman Peon

    Messages:
    450
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Doesn't your first thread say

    Wouldn't you want to just put the get_links inside of this?

    Or am I understanding the question wrong
     
    evossman, Oct 20, 2007 IP
  7. rober7

    rober7 Well-Known Member

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    138
    #7
    the code is :

    <?php wp_list_bookmarks('category=category_id'); ?>

    category_id is a number ... get the number from link of the category ... just hover over and you will see it.
     
    rober7, Mar 1, 2011 IP