Display Custom taxonomy, Child terms and posts in a template Under Specific Parent terms
This is the working code. You can try with yours $id = get_the_ID(false); $categories = get_the_category(); $parents = array(); $childs = array(); foreach($categories as $cat){ if($cat->parent == 0){ $parents[] = $cat; } else { $childs[] = $cat; } } $i = 1; echo “<div class=”sub-container”>”; foreach($parents as $parent){ if($i>3){ $i=1; echo “<div class=”clr”></div>”; echo “<hr … Read more