Support » Fixing WordPress » creating two columns for categories

  • I’m using wordpress to make a quick and dirty newspage for a friend’s bandsite. There are only 2 categories ‘news’ and ‘gigs’, which i’d like to have displayed in two different columns on the page. How can I split things up so wordpress knows which post to put where?

    As this is a quick and dirty excersize, are there readymade templates available I could adapt? I’d really rather not waste days manipulating php code 🙁

Viewing 8 replies - 1 through 8 (of 8 total)
  • are you looking for a three column template? Or are you askin for a two column template that are even in width? Just trying to get an understanding. As for themes available. I recommend

    which has a theme viewer.

    Thanks, but I’m not looking for skinthemes , but rather an existing modified template that has 2 seperate columns for two categories. Category 1 topics go to column 1, category 2 posts go to column 2. The sidebar could be the third columns you mentioned, but I could live without it if needed.

    Ah. So you want an index that runs the loop once for category 1 posts only, dumping them into the left-hand column, and then a second time for category 2 posts only, dumping them into the right-hand column. Sidebar optional. Can’t say I’ve seen anything like that, but it doesn’t sound impossible.

    Have two Loops with each displays different category.
    second example

    Exactly, now all that packed in an existing file for us non php-ers 😉

    Yep, just tried it out and it works like a charm.

    Insert <?php query_posts('category_name=cat1&showposts=5'); ?> just above where your index calls <?php while (have_posts()) : the_post(); ?>. Duplicate this whole block, down to <?php endwhile; ?> for the second category.

    you’ll want to wrap each one with its own div to facilitate CSSing it into columns.

    Afraid that’s the best I’m going to do for you. For what it’s worth, your challenge isn’t php — what I’ve outlined in the post above should take care of your php needs — it’s going to be working up the CSS to lay things out the way you want ’em.

    I use a different way to display 2 lists of categories, but the number of articles (optioncount) works only for one column… Anyone can fix it?

    Here’s the code:

    <ul class="left">
    <?php wp_list_cats('sort_column=name&optioncount=1&
    hide_empty=0&exclude=1,8,14,5,17,12,21,13,20,6'); ?>
    <ul class="right">
    <?php wp_list_cats('sort_column=name&optioncount=1&
    hide_empty=0&exclude=7,18,2,16,11,9,3,19,15,4'); ?>

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘creating two columns for categories’ is closed to new replies.