I came across code here: http://pastebin.com/5HpyYFPN
Basically what I'm trying to achieve is that the user, in the first drop down selects a parent category, and a second dropdownlist auto populates with the sub categories (Based on the user's selection in the first drop down).
This is because a blog that I run has a huge list of categories and sub categories, and filtering using one drop down does not suffice.
I understand using the "get_categories" method I can go about it.
I don't exactly know how to make it a plugin.
I know, you don't need specific cat id's. get_categories('parent=0') returns all the top level categories, loop through them like this: $topCategories= get_categories('parent=0'); foreach ($topCategories as $topCategory) { echo $topCategory->cat_ID; // <- this is the id of the category 1 level below the top category }
Like this you'll dynamically browse through them without ever having to set or know an id yourself .
Please help make this into a plugin. I think it will be useful.
I would have done so myself, but i don't have a clue as to how! Please help!