Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Multiple Category Dropdown WordPress

I have a support page on our site that provides customers the ability to view product documents and software from a specific category. You can see it here [[LINK href=""]][[/LINK]] The drop-down allows you to choose which product you would like view resources from.

I've been searching for a way to allow the user to choose the category first.
Then choose the product. Hopefully, without reloading the page.
I've posted information on wordpress.stackexchange but haven't received any conclusive answers. [[LINK href="null"]][[/LINK]]

Here is the current code for the category dropdown.
<form action="<?php bloginfo('url'); ?>/" method="get">
$select = wp_dropdown_categories('orderby=name&echo=0&depth=0&hierarchical=1&exclude=5,4');
$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
echo $select;
<input type="submit" value="View" />

Any help would be appreciated.

Answers (3)


Hai Bui answers:

Can you post the code for the current dropdown?

Hai Bui comments:

It's pretty hard. This tutorial explains how to do it:
It's exactly what you want


Reland Pigte answers:

I can work on this if you like :)

Zach Shallbetter comments:

How do you mean?

Reland Pigte comments:

The same concept as this I also wrote a plugin that suits the functionality.

But I think Jurre Hanema got it right ;)



Jurre Hanema answers:

I created a small plugin that should do what you want. It lets you select a category and then pulls the child categories from the server using an AJAX request, displaying them in a second drop down.

You can download it here:

In your theme, at the location where you want the two dropdowns to appear, simply insert the following code:

if(function_exists('mcd_print_dropdowns')) mcd_print_dropdowns();

Please let me know if it works for you!

Zach Shallbetter comments:

Excellent, it partially works, when you select the item from the second category drop-down it doesn't take you to the category page. It also show's an empty short drop-down before you select the first one.

Could I also get it to say select-one as a default and only show one initially?

Awesome job!