bartulans
11/24/2017 - 9:38 AM

Widgets

Widgets

<?php
			global $ancestor;
			$cat = '16';
			$childcats = get_categories('child_of=' . $cat . '&hide_empty=1');
			foreach ($childcats as $childcat) {
			  if (cat_is_ancestor_of($ancestor, $childcat->cat_ID) == false){
			    echo '<li><a href="'.get_category_link($childcat->cat_ID).'">';
			    echo $childcat->cat_name . '</a>';
			    echo '<p>'.$childcat->category_description.'</p>';
			    echo '</li>';
			    $ancestor = $childcat->cat_ID;
			  }
			}
			?>