I am trying to create 2 dependent dropdown lists for WP. The section I am trying to create is for recipes so I hope my example is more helpful than the general question.
We have recipes broken down into 2 sections: type of meal (appetizer, main course, dessert etc.) and ingredients (rice, poultry, milk etc.). The type of meal is a category, and ingredients are tags. I am trying to create an ajax code so people can filter our recipes by categories (ie appetizers) or tags (ie chicken), or categories and tags together (ie appetizers that have chicken).
Visitors will start on a category page so ideally the first dropdown should recognize the category users are currently in and list that category by default. The 2nd dropdown's default can say something like "Select Ingredient" and once clicked, it should only list ingredients that are available in that category. So for example, if there are no appetizers with vanilla, vanilla should not be available as a tag in the 2nd dropdown.
Here is a link to something I found to get me started, but I don't know how to make it specifically target the category and tag.
Thanks in advance for your help!