I was doing some research the other day to minimize the space occupied by my single-worded categories, and I found a nice way to do it.
Add the following to your CSS stylesheet:
.right {float:left; width:160px;} .left {float:left; width:160px;}
Add the following to your sidebar, making sure you respect the widget styles:
<div class="widget_box"> <h3>Categories</h3> <?php $cats = explode('<br />', wp_list_categories('title_li=&echo=0&show_count=1&depth=1&style=none')); $cat_n = count($cats) - 1; for($i=0;$i<$cat_n;$i++): if($i<$cat_n/2): $cat_left = $cat_left.'<li>'.$cats[$i].'</li>'; elseif($i>=$cat_n/2): $cat_right = $cat_right.'<li>'.$cats[$i].'</li>'; endif; endfor; ?> <ul class="left"> <?php echo $cat_left;?> </ul> <ul class="right"> <?php echo $cat_right;?> </ul> </div>
That’s it! Test it and tell me how it works.
Hi, thanks for sharing, I will try it.