Here you go:
$args = array(
'post_type' => 'listing',
'order' => 'ASC',
'hide_empty' => false,
'parent' => 0,
);
$listCatTerms = get_terms( 'listing-category',$args);
if ( ! empty( $listCatTerms ) && ! is_wp_error( $listCatTerms ) ){
echo "<ul>";
foreach ( $listCatTerms as $term ) {
echo '<li>'.$term->name.'</li>';
$child_terms = get_categories( array(
'parent' => $term->term_id,
'hide_empty' => 0 ));
//var_dump($child_terms);
echo "<ul>";
foreach($child_terms as $child_term){
echo '<li> -- '.$child_term->name.'</li>';
}
echo "</ul><br>";
}
echo "</ul>";
}
This should display the name of parent category and all its child category after.