We all know that categories are a must in wordpress, in fact they are very important in every CMS, its what keeps your content together, and what unites your blog / website . But for those who don’t write about something specific or just like to have a HUGE list of categories for little content I have developed a nice select drop down box that will show your categories in a nice drop down box. JavaScript is used to change the category instead of pressing the submit button.
First of all I will show you how to make a list of your wordpress categories and sort them out alphabetically :
<?php wp_list_cats(’sort_column=name’); ?>
Please not that I used the wp_list_cats to do so , below in the drop down I will use a different wordpress function called get_categories(); to fetch the categories.
<select name=”event-dropdown” onchange=’document.location.href=this.options[this.selectedIndex].value;’>
 <option value=”"><?php echo attribute_escape(__(’Select Event’)); ?></option>
 <?php
 $categories= get_categories();
 foreach ($categories as $cat) {
    $option = ‘<option value=”/category/archives/’.$cat->category_nicename.’”>’;
   $option .= $cat->cat_name;
   $option .= ‘ (’.$cat->category_count.’)';
   $option .= ‘</option>’;
   echo $option;
 }
 ?>
</select>
This should word for you if you have any problems please leave a comment or contact me and i will try to help how I can.
Hope you enjoyed this wordpress tutorial ![]()

Feb 26, 2008 at 22:38:30
There is actually a much simpler way of doing that. You just call up the function wp_dropdown_categories
more info here: http://codex.wordpress.org/Template_Tags/wp_dropdown_categories
Feb 26, 2008 at 22:53:08
Hmm .. i didn’t know there was such a function in wordpress .. thanks for the info do
Sep 22, 2008 at 14:14:07
For someone whose tag line is ‘because information matters” (no capitals), you’ve certainly obscured as much of it as you can with tacky and tasteless advertising (which remains visible for an eternity and is completely irrelevant to your content). It’s so saturated with advertising in fact that your ‘information’ is inaccessible. A shame really.