WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the wp_dropdown_categories function in my searchform.php file. Right now it lets the user choose what post category they want to search in.

Is there a way I can get the drop down to include a custom taxonomy and a custom post type?

For example if I have a custom post type for galleries, and a custom taxonomy for places... how can I display a wp-dropdown that lets the user choose to search either "photos" or "locations"?

share|improve this question

You should be able to send the desired taxonomies as an argument to the function. This is untested, but should work:

$args = array(
    'taxonomy' => array(
echo wp_dropdown_categories($args);

For your reference, the function wp_dropdown_categories is defined in "wp-includes/category-template.php" on line 301. Take a look at it as it will help you understand what you can send as arguments for the function.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.