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
“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.
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.
“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
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.
thanks again
you are the wind beneath my wings
SEAN