Yup the ‘sort_column=name’ fixed it very nicely. Thank you very much 🙂
That no longer works for my WordPress version 1.5. Anybody have any idea why?
Same question here … anyone … anyone … Bueller?
Also have that problem using 1.5. I’ve tried varying all the parameters for list_cats found in the Codex for template tags, and I can’t get the categories to sort at all in the sidebar. Even tried changing ‘name’ to ‘cat_name’, which is the database field name. Still no go.
Anyone have a solution to sort the categories alphabetically in the sidebar?
<?php wp_list_cats('sort_column=name'); ?>
works for me (WP1.5)
Replace your wp-includes/template-functions-category.php file with this updated version.
thanks ryan,
the updated template-functions-category.php file works for me using list_cats (I am not using wp_list_cats) !
thanks again
I also have the problem that my categories are not listed correctly (fortunately, I copied my photolog to a test environment beforehand, so the version you see now is not yet upgraded).
When I substitute the file, I get the following error message:
Fatal error: Cannot redeclare get_category_rss_link() (previously declared in /…/testwp/wordpress/wp-includes/template-functions-category.php:43) in /…/testwp/wordpress/wp-includes/feed-functions.php on line 104
Restoring the old version at least brings back the photolog, but with unsorted categories.
I am using
<?php wp_list_cats('sort_column=name'); ?>
in my template.
Has anyone figured out the problem with this, as I cannot get my categories to sort alphabetically in WordPress 1.5, using wp_list_cats() or just list_cats() with the appropriate options. I tried downloading that updated template-functions-category.php file, but no change in behavior. Anyone have ideas if this is a known bug or if anyone has a work-around as of yet?
Same here. Also not displaying post count
I too have been having problems with this and WordPress 1.5 – list_cats() partially works, in that it lists the items alphabetically, but my use of categories is a little more complex.
I’m using wordpress to maintain a film criticism website (www.filmforensics.com). In 1.2 I had two areas of categories: one a list of genres (comedy, drama, etc.) and one a list of letters of the alphabet, so that you could search on either. I used the ‘child_of’ option to sort them into the two sublists, but, with the same code, that no longer works. The parent of the alphabetical categories had ID 10:
<?php list_cats(1, ‘all the films’, ‘name’, ”, ”, 1, 0, 1, 1, 1, ‘TRUE’, ’10’, ”, ”, ”, ”, ”); ?>
…and this now lists all the entries, not just those under ID 10. Having said that, they are alphabetical!
Could it be changes in the version of php required?
I wrote a plugin last week that you might find helpful:
http://wordpress.org/support/topic.php?id=24026
Dunno if it will solve your problem, but it might be of some use meanwhile.
Thank you Ryan! Sorted categories AND post counts! And, no messy code editing, just a file replacement. Niiiiiiiiiiiiiiiiiiiiice. I love this forum!
-kj-
kj99gt
Thanks, ryan. The updated template-functions-category.php now sorts the categories correctly. One minor problem remains, namely, that hierarchical categories are not listed at all unless the parent category is listed.
The workaround is simple: ensure that each parent category has at least one post.
Just found this thread, which sorted out the problem that I had – I thought I was going mad, as I couldn’t persuade it to sort alphabetically.
Also, switching from using list_cats to wp_list_cats, meant that it was far easier to read.