• Resolved picaboy

    (@picaboy)


    I want to have the category listing be in two columns instead of one. For example I am looking to do this:

    Category 1 Category 4
    Category 2 Category 5
    Category 3 Category 6

    Does anyone know of an updated plugin to achieve this task?

Viewing 1 replies (of 1 total)
  • Thread Starter picaboy

    (@picaboy)

    Nevermind, figured it out:

    <?php
    $cats = explode("<br />",wp_list_categories('title_li=&echo=0&depth=1&style=none&show_count=1'));
    $cat_n = count($cats) - 1;
    $cat_col = round($cat_n / 2);
    for ($i=0;$i<$cat_n;$i++){
    if ($i<$cat_col){
    $cat_left = $cat_left.'<li>'.$cats[$i].'</li>';
    }
    elseif ($i>=$cat_col){
    $cat_right = $cat_right.'<li>'.$cats[$i].'</li>';
    }
    }
    ?>
    <table border="0" width="260"><tr>
    <td><ul>
    <?php echo $cat_left;?>
    </ul></td>
    <td><ul>
    <?php echo $cat_right;?>
    </ul></td>
    </tr></table>
Viewing 1 replies (of 1 total)
  • The topic ‘Two Column Category Listing’ is closed to new replies.