WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using custom taxonomies. I have multiple categories and each category has multiple children. I would like to display the categories in two columns on my homepage similar to linkcentre.com.

I tried using wp_list_categories but could not split its output into two columns.

I tried this solution but it only works when there are no subcategories.


share|improve this question
I answered a similar question here. I think it will work for you. wordpress.stackexchange.com/questions/25433/… – Rutwick Gangurde Nov 17 '11 at 9:31
actually it would work fine if there are no subcategories. In our case each category has multiple children so count($cats) will also include the number of child categories. – Ankit Nov 17 '11 at 12:00
up vote 1 down vote accepted

You don't need any code changes to your PHP or html!

Assuming the following code was used:

<ul class="mypagelist">
    <?php wp_list_pages('sort_column=menu_order&title_li='); ?>

Resulting in:

<ul class="mypagelist">
    <li>Page 1</li>
    <li>Page 2</li>
    <li>Page 3</li>
    <li>Page 4
            <li>Subpage 1</li>
    <li>Page 5</li>

Use CSS along the following lines:

.mypagelist { width:600px; /* or any other size */ }
.mypagelist li { float:left; width:290px; margin-right:10px /* width + margin = width of parent divided by 2 */ }
.mypagelist li ul { display: none; /* don't show subpages */ }

Finally, we need a clearing element at the end ( or on the container containing the page list call ). e.g. <div style="clear:left;"></div>, although I would avoid inline styling where possible.

The same can be done for any unordered list, categories, pages, nav menus, etc

share|improve this answer
interesting take on the problem.... I will try to implement it and see if it works for our case... – Ankit Nov 17 '11 at 12:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.