multi column child category
-
I have attempted to use some code to pull all of the children of a specific category, and then display in three columns. However my attempts have been unsuccessful thus far. Below is my code, and any help would be greatly appreciated:
?php
$catArray = explode(“”,wp_list_categories(‘orderby=name&show_count=1&use_desc_for_title=0&child_of=8&exclude=&title_li=’));
$catCount = count($catArray) – 1;
$catColumns = round($catCount / 3);
$twoColumns = round($catColumns + $catColumns);for ($i=0;$i<$catCount;$i++) {
if ($i<$catColumns){
$catLeft = $catLeft.”.$catArray[$i].”;
}
elseif ($i<$twoColumns) {
$catMiddle = $catMiddle.”.$catArray[$i].”;
}
elseif ($i>=$catColumns){
$catRight = $catRight.”.$catArray[$i].”;
}
};
?>
- The topic ‘multi column child category’ is closed to new replies.