Lista as subcategorias de uma categoria num select.
<form action="#" class="form-field" id="ID_DO_SELECT">
<?php
$taxonomia = 'ID_DA_SUA_TAXONOMIA';
$args = array(
'orderby' => 'name',
'parent' => 0,
'taxonomy' => $taxonomia,
'hide_empty' => 0,
);
$categories = get_categories( $args );
foreach ($categories as $category) {
echo '<div class="form-field-select"><select name="NOME_DO_CAMPO_AQUI" id="NOME_DO_CAMPO_AQUI-'.$category->cat_ID.'"><option>'.$category->cat_name.'</option>';
$theid = $category->term_id;
$children = $wpdb->get_results( "SELECT term_id FROM $wpdb->term_taxonomy WHERE parent=$theid" );
$no_children = count($children);
// VERIFICA SE A CATEGORIA POSSUI SUBCATEGORIA
if ($no_children > 0) {
$args2 = array(
'orderby' => 'name',
'parent' => 1,
'taxonomy' => $taxonomia,
'hide_empty' => 0,
);
$args2["parent"] = $category->term_id;
$categories2 = get_categories( $args2 );
foreach ($categories2 as $category2)
echo '<option value="'.get_category_link( $category2->cat_ID ).'">'.$category2->cat_name.'</option>';
}
echo '</select><!--/.NOME_DO_CAMPO_AQUI--></div><!--/.form-field-select-->';
} ?>
</form>