WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Using Get_links

[Resolved] Using Get_links

  • nabitunics
    Member

    @nabitunics

    Hi,

    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?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Samuel Wood (Otto)
    WordPress.org Tech Dude

    @otto42

    Have you read this?
    http://codex.wordpress.org/Template_Tags/get_links

    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.

    nabitunics
    Member

    @nabitunics

    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?

    Thanks

    Samuel Wood (Otto)
    WordPress.org Tech Dude

    @otto42

    Like this:

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

    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.

    nabitunics
    Member

    @nabitunics

    You are a wonderful, fabulous individual.

    Thank you thank you thank you!

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