Category columns code not working
-
I am looking to make my categories into 3 columns and I found this code but it does not work in 2.8. Can anyone one please help make it work. If you can help me in anyway it would great.
<?php
$cats = explode(“
“,wp_list_categories(‘show_count=1&child_of=’.$cat.’&hide_empty=0&title_li=’));
$cat_n = count($cats) – 1;
for ($i=0;$i<$cat_n;$i++):
if ($i<$cat_n/2):
$cat_left = $cat_left.’- ‘.$cats[$i].’
- ‘.$cats[$i].’
‘;
elseif ($i>=$cat_n/2):
$cat_right = $cat_right.’‘;
endif;
endfor;
?>
<ul class=”left”>
<?php echo $cat_left;?><ul class=”right”>
<?php echo $cat_right;?>Here is the CSS part.
.right {float:left; width:200px;}
.left {float:left; width:200px;}Thank you.
The topic ‘Category columns code not working’ is closed to new replies.