If you’re a blogger with OCD you might be interested in my new Category Sort plugin. It simply alphabetizes the category list that gets printed out when the the_category() function is called. Wordpress sorts this list according to category ID, which has always seemed completely random and bugged the hell out of me. Since I’m using this plugin, the categories for this post are “plugins, wordpress” instead of “wordpress, plugins”. This is not that exciting, but it looks nicer. Download it at the plugin page.

16 Responses

  1. 1 Geek

    Nice, that’s always got under my skin too!

  2. 2 John Lamansky

    Awesome! Just what I was looking for. Thanks!

  3. 3 Michael

    Unfortunately, the link to the plugin page does not work (error 404)

  4. 4 joey

    sorry about that, everything should be working again. there was a little bit of a database meltdown recently and that was one thing that didn’t get fixed.

  5. 5 Georgina

    Thanks for writing this plug-in. Very handy.

    Since installing it, I’ve found that sometimes one category per post (and only one) is output without a space after the comma, like: “movies, books,tv, music”.

    I made a hacky fix for my site (editing the plug-in to add a space to the end of $joined) but I thought you’d want to know about the issue.

    Cheers.

  6. 6 Inside

    hi! I just installed your plugin..but it’s not working :( Please help..

  7. 7 Denis de Bernardy

    what’s the license? (please cc the reply by email)

  8. 8 joey

    i hereby release this plugin under a very liberal “do whatever you want with it” license.

  9. 9 Designer

    I installed it on the latest wordpress 2.0.5 and it doesn’t work. Help.

  10. 10 Tom

    Is your plugin compatible with the new 2.1 release of wordpress?

  11. 11 Jenny

    I’ve tried it on 2.1 and it’s working for me.

  12. 12 Dave

    I just upgraded to WordPress 2.2.2 a few days ago, and this plugin seemed to break the category selector on the Write Post page. I disabled it and things went back to normal. Not sure what the problem is.

  13. 13 Dustin

    It seems the sort is case sensitive. This will mean ‘Z*’ will come before ‘a*’. Was this done on purpose?

  14. 14 Dustin

    Dave

    I have that same problem in v2.2.3.

  15. 15 joey

    Dave & Dustin,
    I haven’t upgraded Wordpress in a while, I’ll try to get this working but time is in short supply right now.

    Dustin,
    It’s just using PHP’s ksort() function. I guess I never noticed because all of my categories are lowercase! I’ll work on that too.

  1. 1 ddhr.org

Leave a Reply


My name is Joey Nelson. I'm a web developer living in Raleigh, NC and working with Node.js, MongoDB, Ruby, PHP, jQuery and some other stuff. More about me.