Support » Fixing WordPress » Alphabetizing dropdown categories in 2.3

  • Resolved msadventures


    Hi all – I’ve just put a code in the sidebar of my theme for dropdown categories, and it worked fine on earlier versions of WP, but now the alphabetizing doesn’t work in 2.3, can anyone help?

    Here’s the code I’m using:

    <form action="<?php echo $PHP_SELF ?>" method="get">
    <div style="text-align:center">
    <p><?php dropdown_cats(TRUE, 'Choose...', 'NAME'); ?></p>
    <p><input type="submit" name="submit" value="Go!" /></p>


Viewing 5 replies - 1 through 5 (of 5 total)
  • I’ve been searching around, trying to figure out how to fix this. So far I’ve tried switching to just this:

    <?php wp_dropdown_categories(); ?>

    but again, can’t figure out how to get it to alphabetize. I’ve tried putting in sort_column=name, and that’s not working.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Try this:

    The documentation:

    Ah, thanks that one worked! I’d also like to set it so that a category doesn’t show up in the window, but instead the word “Choose…” or something like that, but I can’t quite figure out, from that link you gave me, how to fix it to say that. I know I need to fix one of those variables, but I’m not sure what I need to enter or leave out as far as that code in the “default” box, if that makes any sense.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    You’d either use show_option_all or show_option_none, depending on what you want the “Choose…” itself to do.

    Like so:

    Or so:

    Or even both:

    That last one uses the “none” as a separator.

    Aha! That first one was just what I was after, thanks Otto! 😀

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Alphabetizing dropdown categories in 2.3’ is closed to new replies.