get_links_list sort problem (6 posts)

  1. dpbeatley
    Posted 10 years ago #

    Hi all,
    I have inserted the following into my WP 1.5 template:
    Recommended Links
    <?php get_links_list('name'); ?>

    It works fine except that the sort order appears to be 'random' each time the page is refreshed. It's not my template since even the default theme (with no mods) exhibits the same behavior. Since I'm specifying that the order should be by 'name' why am I getting this 'random' listing.

    Thanks much -- dennis

  2. samsm
    Posted 10 years ago #

    I just tried out get_links_list('name') and had the same experience as you.

    The long version...

    get_links(-1, '<li>', '</li>', '<br />', FALSE, 'name', TRUE,TRUE, -1, TRUE);

    ... seems to work acceptably.

    That function and its arguments are detailed here: codex: get_links().

  3. dpbeatley
    Posted 10 years ago #

    Thanks for the tip - will try that version. Hopefully the WP team fixes this, or at least explains the behaviour.

  4. Kafkaesqui

    Posted 10 years ago #

    dpbeatley: Just to confuse the issue, I can't seem to duplicate this problem. For me, get_links_list('name'); outputs links alphabetically, first by link category, then by link. There's no apparent randomness.

  5. ElBuzzard
    Posted 10 years ago #

    I had the same problem.

    I found that under the admin panel, the links sort order for the default cateogry was set to random by default. Check it out and see if that helps.

  6. ineedhelp
    Posted 10 years ago #

    i have a question about get_links_list() tag:

    in the admin area - if you specify the amount of links to display in the category then this is fine for the sidebar, but is there a way to overwrite this for the links page? i.e. would it be possible to only display 5 links in category x in the sidebar, but when viewing the links page display all the links for category x?

    have a look at http://mewebdev.net/journal/ to get an idea of what i'm talking about...

    thnx in adv.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.