Category columns in wordpress

Discussion in 'Content Management' started by Articlestopost.com, Oct 18, 2009.

  1. #1
    I need to make my category into 3 columns. I found this code but it does not work in version 2.8. Can anyone help me with it please.

    <?php
    $cats = explode("<br />",wp_list_categories('show_count=1&child_of='.$cat.'&hide_empty=0&title_li='));
    $cat_n = count($cats) - 1;
    for ($i=2;$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>

    Here is the CSS part.

    #right {float:left; width:140px;}
    #left {float:left; width:140px;}

    Any help would be useful. Thank you.
     
    Articlestopost.com, Oct 18, 2009 IP
  2. Ruddo

    Ruddo Member

    Messages:
    821
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Ruddo, Oct 18, 2009 IP
  3. Articlestopost.com

    Articlestopost.com Member

    Messages:
    138
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    That is the theme I need it for. I would like the category pages to have 3 columns instead of one.
    Please can anyone take a look at the code for me. I have been at this all weekend with no good results.
     
    Articlestopost.com, Oct 19, 2009 IP