if (is_category()) {
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
?>
//echo "
";
//wp_list_categories('orderby=id&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID);
//echo "
";
$categories = wp_list_categories('show_count=0&depth=1&title_li=&echo=0&child_of='.$this_category->cat_ID); //&hierarchical=0
$category_array = preg_split('/\n/', $categories);
$count = count($category_array);
$i = 0;
$flag2 = true;
$flag3 = true;
echo "
";
while ( $i < $count ) {
if($i/2<3) echo preg_replace('/
- /i', '
- ', $category_array[$i]) . "\n";
else if($i/2>=3 && $i/2<6) {
if($flag2){ echo preg_replace('/
- /i', '
- ', $category_array[$i]) . "\n"; $flag2=false;}
else echo preg_replace('/
- /i', '
- ', $category_array[$i]) . "\n";
}
else if($i/2>=6) echo preg_replace('/
- /i', '
- ', $category_array[$i]) . "\n";
$i++;
}
echo "
";
?>