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:
<ul> <li> <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> </div> </form> </li> </ul>
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.
The documentation: http://codex.wordpress.org/Template_Tags/wp_dropdown_categories
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.
You’d either use show_option_all or show_option_none, depending on what you want the “Choose…” itself to do.
Or even both:
That last one uses the “none” as a separator.
- The topic ‘Alphabetizing dropdown categories in 2.3’ is closed to new replies.