WP Category List in 2 Rows

Discussion in 'PHP' started by freakitude, Aug 31, 2007.

  1. #1
    Hi,

    I have a wordpress theme with a wide sidebar. I want the category list to be divided into two rows instead of one long row.

    [​IMG]

    Is there any way to do this ?

    Is there anyway to get first half categories so i can apply style=float:left and then get second half categories and apply float:right..or any other way. :confused:

    Any help will be highly appreciated.
     
    freakitude, Aug 31, 2007 IP
  2. mikebrad0927

    mikebrad0927 Peon

    Messages:
    266
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sure, it's easy to do. Just use wp_list_categories like this:

    
    <div style="float:left;">
    <?php wp_list_categories('include=1,2,3,4,5'); ?>
    </div>
    <div style="float:left;">
    <?php wp_list_categories('include=6,7,8,9,10'); ?>
    </div>
    
    Code (markup):
    Where categories with ids 1,2,3,4, & 5 are in the left column and 6,7,8,9, & 10 are in the right column.

    I'm presuming that you are using WP2.1 or higher.

    http://codex.wordpress.org/Template_Tags/wp_list_categories
     
    mikebrad0927, Aug 31, 2007 IP