How to Display All Your WordPress Categories in a Drop Down Menu

Do you have too many categories to display in your navigation menu? If you want to conserve space on your page but still want to make those categories available, you can easily add them all to a drop down menu like so:

{code type=php}

]*)>#”, ““, $select);
echo $select;

Drop that anywhere in your theme’s template files where you want the category drop down menu to appear.