WordPress.org

Ready to get started?Download WordPress

Forums

creating two columns for categories (9 posts)

  1. fl4nk
    Member
    Posted 8 years ago #

    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 :(

  2. Jinsan
    Member
    Posted 8 years ago #

    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

    http://wrc.os42.com

    which has a theme viewer.

  3. fl4nk
    Member
    Posted 8 years ago #

    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.

  4. mumkin
    Member
    Posted 8 years ago #

    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.

  5. Joshua Sigar
    Member
    Posted 8 years ago #

    Have two Loops with each displays different category.

    http://codex.wordpress.org/The_Loop#Multiple_Loops_Version_1
    second example

  6. fl4nk
    Member
    Posted 8 years ago #

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

  7. mumkin
    Member
    Posted 8 years ago #

    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.

  8. mumkin
    Member
    Posted 8 years ago #

    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.

  9. katapulp
    Member
    Posted 8 years ago #

    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:

    <li>Categories:
    <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>
    <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'); ?>
    </ul>
    </li>

    http://www.regarde.org/blog/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.