I have a question I hope you can help me with. I have a custom taxonomy called locations and on the first level I have the areas (Asia, Europe, etc) and under each area I have countries (England, South Africa). What I would like to do it display a dropdown menu of all the children of that particular parent similar to what was done here, http://wordpress.org/support/topic/terms-of-custom-taxonomy-in-a-dropdown-menu . However, I want the dropdown to only display the children of the parent page I am currently on, not all the terms. So if I am on North America I want it to show the United States and Mexico and if I am on the Europe parent page I want it to show England.

Does that make sense?


  • Sweetness that works great one last question. When I am on the parent page it works great but when I am on the child page it displays an empty list is there any way when on a child page it can display all the children of its parent.
    – Nick Hamze
    Commented Apr 14, 2011 at 13:56

1 Answer 1


You can use get_query_var( 'term' ) to get the current term and get_query_var( 'taxonomy' ) to get the current taxonomy, then all that is left is to use [wp_dropdown_categories()][1] function withchild_ofparameter andtaxonomy` parameter, so something like this:

//first get the current term
 $current_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
//then set the args for wp_dropdown_categories
 $args = array(
    'child_of' => $current_term->term_id,
    'taxonomy' => $current_term->taxonomy,
 wp_dropdown_categories( $args );



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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