• Resolved firehead

    (@firehead)


    Ok ok I know there are tons of similar threads to this, but I searched around and I can’t find anyone who DOESN’T want their link categories alphebetized.

    I’m not talking about Archives, Categories, Meta, or any of that. I’m talking about link categories I create. The default is “Links”.

    On my page (www.the-firehead.com) I’ve created a few different ones, and I’d to be able to put the categories in whatever order.

    I don’t want to sort them by name, or by ID.

    So INSTEAD of the order they are in now:

    Coolness Personified
    Music worth listening to …
    Places worth going to …
    I am all over the place …
    Stuff worth looking at …
    Brothers
    Sisters

    I want them to be:

    Sisters
    Brothers
    Coolness Personified
    I’m all over the place …
    Places worth going to …
    Music worth listening to …
    Stuff worth looking at …

    What do I do?

    SEAN

Viewing 13 replies - 1 through 13 (of 13 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Either code the list manually, or re-do the links so that their IDs are in the order that you want.

    I’m pretty sure there’s some info on this in the codex…. http://codex.wordpress.org/Main_Page, search on links, listing

    Thread Starter firehead

    (@firehead)

    “Either code the list manually, or re-do the links so that their IDs are in the order that you want.”

    What happens when I want a new category in a couple months? Or I decide the way I have it organized now is stupid and I want to change it? (likely!)

    Don’t get me wrong, WordPress is great, but I should be able to change the ID when I want to!!

    Well I know that the “get_links_list()” function is grabbing the links from somewhere … where is it grabbing them from? Maybe I can get to that list and change the ID’s manually?

    SEAN

    Probably…. check the codex as I posted above.

    Thread Starter firehead

    (@firehead)

    I did. None of the search topics that came up have to do with what I need.

    Hmm. Well, some of the coding gurus around might eventually be able to help you with a specific if/else statement then…. but I can’t. I don’t do code, sorry.

    You could edit your sidebar.php to list the link categories in the order your want by making multiple request for get_links

    <?php get_links('1', '<li>', '</li>', '', 0, 'name', 0, 0, -1, 0); ?>
    <?php get_links('2', '<li>', '</li>', '', 0, 'name', 0, 0, -1, 0); ?>
    <?php get_links('3', '<li>', '</li>', '', 0, 'name', 0, 0, -1, 0); ?>

    The number that is different is the category id, this will allow you to display them in the order you want.
    Not a great solution but it should work…

    My way of doing this was to alter the settings for the link category so that links were listed by rating, then rate the links in the order I wanted them listed.

    Thread Starter firehead

    (@firehead)

    “You could edit your sidebar.php to list the link categories in the order your want by making multiple request for get_links”

    ok that worked for the links, but there are no category titles any idea how to get those?… sorry I’m formerly a programming major, but I’ve been out of the loop for a couple years … I don’t know PHP that well!!

    SEAN

    Sorry Sean, I didn’t explain it all.
    This is what you would require in your sidebar to achieve what you are looking for:
    <li>
    <h2><?php _e('Sisters'); ?></h2>
    <ul>
    <?php get_links('1', '<li>', '</li>', '', 0, 'updated', 0, 0, -1, 0); ?>
    </ul>
    </li>

    You will have to copy and paste this code over and over again for each category that you want displayed. Change the word “Sisters” to the proper category name for each and the number “1” for each link category ID. The word “updated” means that the links under that heading (example: Sisters) will be sorted by when they were last updated.

    you can find more info for what each item between single quotes means here: http://codex.wordpress.org/Template_Tags/get_links

    Jeff

    Thread Starter firehead

    (@firehead)

    sweet thanks!

    one more question while I’m at it though, instead of “updated” or “name” can I put in “random” and have it sort them randomly?

    and check my blog, I replied to your comment about the song.

    SEAN

    Yep, just use rand

    you can also sort by:

    id, url, name, target, category, description, owner, rating, updated, rel, notes, rss and length – The length of the link name, shortest to longest.

    Thread Starter firehead

    (@firehead)

    thanks again

    you are the wind beneath my wings

    SEAN

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Sidebar Alphebetized AND I DON’T WANT IT TO BE’ is closed to new replies.