Support » Fixing WordPress » Arrange Category List Alphabetically?

  • Resolved DavidDeCristoforo


    Hi all…been a while since I’ve visited. Thanx to the incredible support I have gotten here in the past, my wife’s blog has been doing great even though I (the “admin”) don’t know squat! However, she has added a lot of categories and they are listed in the order of creation. She would like to have them display alphabetically. I’m sure this is one of those things that falls under the “it’s easy if you know how” heading. But, I don’t! Any help would, as usual, be most appreciated.


Viewing 15 replies - 1 through 15 (of 22 total)
  • David,

    Depending on whether you are using ‘wp_list_cats’ ( or ‘list_cats'(, you’ll want to add the parameter for ‘sort_column’. Set the column to ‘cat_name’ and set the order to either ‘ASC’ or ‘DESC’.

    OK, I told you I don’t know squat! However, I did find the following line in a flle called “leftbar.php” (part of my Vesuvius 1.5 theme)

    <?php wp_list_cats(); ?>

    Is it safe to presume that this is where I would need to add the sort parameter?

    Thanx very kindly for your assistance.

    For getting the_category() function alphabetically:

    Try replacing it with this:

    <?php wp_list_cats(‘sort_column=name&sort_order=asc’); ?>

    This should get you going. Of course you could also try the plugin that Michael suggested.

    Well, I installed the plug-in and activated it but my categories are still not in ABC order. Tomorrow I will try to mod the code per slipstream’s sug.

    Thanx all

    ARRRG! Well, the plug in not only failed to order the category list, it also caused a “bad information” warning to appear below the title of each post! So I deactivated the plug in and tried editing the sidebar template as per slipstream’s suggestion. Unfortunatly this accomplished nothing other than keeping me from thinking about “the war” for a bit!

    Anyway, if anyone has any other ideas……and thanks for the suggestions…



    I’m not sure what happened when you tried to edit the sidebar. Try checking here for a bit more info:


    Well thanx for helping. I rechecked the sidebar template and the code looks correct. Maybe I have something effed up. I posted the code for the template here:



    I just went to check and realised that you use WP 1.5 still. I tested the same code on my site using WP2.03 and it worked fine.

    I’m not very experienced with 1.5 so can’t be of much help there. Maybe you want to consider upgrading or hopefully someone else with 1.5 experience can help you.


    Upgrading may be in order. I was looking at the instructions and it looks like I can still use the same template in the newer version. I’ll back up everything tomorrow and give it a go. Really appreciate your taking the time to help. I’ll let you know how it goes.


    Well…I upgraded (no problems!) today but I still can’t get the cats to list as ABC. Nor does the plug-in work! So…back to square one. This time I uploaded all of my theme files to:
    Don’t know if anyone wants to mess with this but just in case…
    At least I have the latest version now!

    BTW, here are the two error messages I get when i activate the plug-in:

    Warning: explode(): Empty delimiter. in /home/naturalf/public_html/wp-content/plugins/cat_sort.php on line 14

    Warning: Invalid argument supplied for foreach() in /home/naturalf/public_html/wp-content/plugins/cat_sort.php on line 14

    This appears between the heading and body of each post on the blog. Everything returns to normal if the plug-in is deactivated.

    It seems that there is something in my template that is blocking the alphabetical ordering of the cats list. I tried switching to a different theme and the cats were in alphabetical order. Now, if I could just figure out what…..


    Are you using the plugin or WPs built in function for sorting now?

    Also we can’t access the theme files you put in misc since they all have a php extention and your server tries to parse it and only gives us the output not the code.

    Oops…sorry! I reloaded text versions:

    Right now the plug-in is deactivated. I changed the code for the sort order as suggested but the cats still dont sort…

    Thanx Again

    I’m looked at the files and am having a hard time figuring out the problem. Could you zip the directory for the theme you use and post it somewhere. I’ll download it and test it in my WP install to see if I can find the problem.

    On a side note you may want to try the navigation plugin I wrote WP-dTree ( It replaces the navigation that you use, so I’m not sure if you’ll like it, but it does have the ability to do the sort.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Arrange Category List Alphabetically?’ is closed to new replies.