drop-down list another query

Just a standard HTML form will do!

<form action="<?php echo home_url("https://wordpress.stackexchange.com/"); ?>" method="get">

    <p><?php wp_dropdown_categories('taxonomy=taxonomy-1&name=taxonomy-1'); ?></p>
    <p><?php wp_dropdown_categories('taxonomy=taxonomy-2&name=taxonomy-2'); ?></p>
    <p><input type="submit" value="Search!" /></p>

</form>

Just replace taxonomy-1 and taxonomy-2 with the names of your taxonomies.

Important

If you registered your taxonomy with a custom query_var, you’ll need to match it in the name argument of wp_dropdown_categories().

Also, querying multiple taxonomies is not supported as of 3.02 – you’ll need the 3.1 beta, a plugin or additional filters.

Leave a Comment