WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Similiar to category drop down box for a list of terms with the same parent, I want to make such a drop down for a list of tags with the same group name( or some other conditions that works). Seems WP doesn't provide a way to use term group, any other way to make the drop down ?

share|improve this question
If your terms are grouped they are hierarchical. So use a hierarchical taxonomy instead. – toscho Jan 6 '12 at 2:01
Thanks! Seems have to use category. – Jenny Jan 6 '12 at 4:06
The term_group is used internally for term aliasing, you shouldn't really try to override it with anything. – Otto Sep 11 '12 at 20:07

The examples i quote in my answer can be found here, i also recommend you read that page carefully to help you with this.

But lets grab an existing example there and change it a bit.


//you must change the parameters in the get_terms function to get exactly the terms you want
$terms = get_terms("my_taxonomy");
$count = count($terms);
if ( $count > 0 ){

    //the onchange value allows you to go to the term page when you select it, if you dont want that, remove it and remove the value in the options too
    echo '<select onchange="document.location.href=this.options[this.selectedIndex].value;">';
    foreach ( $terms as $term ) {
      echo '<option value="'.get_term_link($term->slug, 'CHANGE-THIS-TO-YOUR-TAXONOMY-NAME').'">' . $term->name . '</option>';
    echo "</select>";

//more on the get_term_link function here: http://codex.wordpress.org/Function_Reference/get_term_link


I hope this answers your question.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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