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

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:
<form action="<?php bloginfo('url'); ?>/" method="get"><?php $select = wp_dropdown_categories('show_option_none=Select Category&show_count=1&orderby=name&echo=0&selected=6'); $select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select); echo $select; ?></form>
Drop that anywhere in your theme’s template files where you want the category drop-down menu to appear.
Create your free account to post your comment
Login to post your comment