php - Output (echo?) direct children of parent custom taxonomy in a loop -
i'm trying output 1st child level (not parent or grandchildren) custom taxonomies in loop of sort, can add custom fields / thumbnails it. i created hierarchical custom post type called 'product-type' and there few levels of custom taxonomies it. level 1 - snacks level 2 - chocolates (just showing 1 example) level 3 - milk chocolates, dark chocolates ..and on. on parent taxonomy page, i've been able list existing level 2 taxonomies following code: <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); if ($term->parent == 0) { wp_list_categories('taxonomy=product-type&depth=1&show_count=0 &title_li=&child_of=' . $term->term_id); } else { wp_list_categories('taxonomy=product-type&show_count=0 &title_li=&child_of=' . $term->parent); } ?> the output looks this: <li class="cat-item cat-item-7"> <a href="......