The below code works really well for pulling in a select option list for all the entries in a custom taxonomy called 'make'. It only pulls in parent level ones which is perfect.
<select id="make" name="make">
<option value="">--</option>
<?php $term_query = new WP_Term_Query( array( 'taxonomy' => 'make', 'parent' => 0 ) ); if ( ! empty( $term_query->terms ) ) {
foreach ( $term_query ->terms as $term ) {
echo '<option class="' . $term->name . '" value="' . $term->name . '">' . $term->name . '</option>';
}
} else {
};?>
</select>
However, i would like to create another identical version of this code but instead of pulling in a list of all the parent values, it should pull in all the child values. Not for a particular page or post, but should output a select list of ALL the child entries of a custom taxonomy, ignoring the parents. Any help is massively appreciated!