您可以使用get_query_var( \'term\' )
获取当前术语和get_query_var( \'taxonomy\' ) to get the current taxonomy, then all that is left is to use [wp_dropdown_categories()][1] function with
的子项parameter and
taxonomy参数,如下所示:
//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 );
完成!