Support » Fixing WordPress » Using Get_links

  • Resolved nabitunics



    I have read through post after post after post and haven’t found the answer to this question, so I’m sorry if it’s been asked before.

    I currently have a box on my sidebar which displays all my links in all my categories using get_links_list(‘id’)

    What I want to do is create two separate boxes, one which displays just categories 2 and 3 and one which displays category 1.

    I have tried and tried and tried and am currently feeling very dumb because, no matter what I try I can’t get them to display in exactly the same format as get_links_list(‘id’) including the category name etc.

    I want it to look exactly the same just with my choice of categories.

    Can anyone put me out of my misery and tell me how to do it?


Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Have you read this?

    Displaying two different categories of links at once is not something get_links can easily do. You may want to resort to a plugin to do this sort of thing.

    Thanks Otto42.

    I had read that article but failed to understand it (possibly too much caffine).

    Let’s limit it to just one category…. how do I display just one category and still have it formatted the way get_links_list(‘id’) would format it?


    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Like this:

    <li id="linkcat-1"><h2>Your Category Name</h2>
    get_links(1, '<li>', '</li>', 'n', FALSE, 'id', FALSE, FALSE, -1, FALSE);

    The “1” after get_links is your category. The rest defines exactly how it displays the link. All the stuff around the get_links call is the HTML to make it look exactly like get_links_list does, although you can change that if you like.

    You are a wonderful, fabulous individual.

    Thank you thank you thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using Get_links’ is closed to new replies.