', '' ); ?>
0 // to get only parent terms ); $terms = get_terms( $taxonomy, $args ); foreach( $terms as $term ) { echo '
'; echo '

'.$term->name.'

'; $args = array( 'parent' => $term->term_id ); $subterms = get_terms( $taxonomy, $args ); foreach( $subterms as $subterm ) { echo "
"; echo "

".$subterm->name." ".$subterm->description.""."

"; $args = array('post_type' => 'drink', 'tax_query' => array( array( 'taxonomy' => 'drink_category', 'field' => 'slug', 'terms' => $subterm->slug, 'include_children' => false, ), ), ); $loop = new WP_Query($args); if($loop->have_posts()) { while($loop->have_posts()) : $loop->the_post(); ?>

"; } echo "
"; } ?>