About side bar setting

Is it possible to display two columns in Category section in side bar?
It’s quite a lot (as I want to display child categories too), and I think it looks better if I can display in two columns instead of one.

My site is http://styleimported.net/

Thank you for your support in advance.

The easiest option here would be to use dropdown option for category widget. Otherwise, default WordPress widget doesn’t support this kind of behaviour and you would have to recreate it.

There is a simple workaround but it you will lose most of the formatting and flexibility of this widget.

.widget ul li a {
    width: 50%;
    float: left;
}

I’ve seen the code below in several site, it didn’t work but is it possible to use this kind of code to make two column? Thank you so much for your time

<?php
$cats = explode("",wp_list_categories('title_li=&echo=0&depth=0&style=none&hierarchical=1'));
$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>

I see that you didn’t try to use code I provided above. It is best that there is as categories are not meant to be in multiple columns.

.widget_categories ul li a {
    width: 50%;
    float: left;
}
.widget_categories {
    overflow: hidden;
}

You will have to play around how to add those categories to make them align perfectly but this is something that you can’t do via CSS. Just add the right number of categories and it will do the trick.

This is also a hacky way to do it but there aren’t anything cleaner than this because categories are just not meant to be aligned like that.

The best option here would be to create completely new custom widget and by default implement the right PHP, HTML and CSS.

Thanks for your reply. I tried the code above and it worked.
However, what I want to do is to move each Parent Category on top of child categories.
Is it possible to make it like below?

> Parent Category1 > Parent Category2
> child 1-1 > child 2-1
> child 1-2 > child 2-2
> child 1-3 > child 2-3
> Parent Category3 > Parent Category4
> child 3-1 > child 4-1
> child 3-2…

I appreciate your support!