Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

What is the best way to split multiple categories into two columns on the page?

At this moment I don't need category-A to go into column-1 and category-B/C/D to go into column-2. I just need multiple categories to spilt in to two columns irrespective of what they are.

the code for the page currently looks like:

<?php get_header(); ?>

<div id="articles-wrap" class="row span_9">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

        <article <?php post_class() ?> id="post-<?php the_ID(); ?>">
            <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
            <?php include (TEMPLATEPATH . '/_/inc/meta.php' ); ?>
            <div class="entry">
                <?php the_content(); ?>
            </div>
            <footer class="postmetadata">
                <?php the_tags('Tags: ', ', ', '<br />'); ?>
                Posted in <?php the_category(', ') ?> | 
                <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?>
            </footer>
        </article>

        <?php endwhile; ?>
        <?php include (TEMPLATEPATH . '/_/inc/nav.php' ); ?>

    <?php else : ?>

        <h2>Not Found</h2>

    <?php endif; ?>
</div><!-- articles-wrap | row span_9 -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Thanks

share|improve this question
1  
What exact part of your question is your current template doing/solving? –  kaiser Nov 7 '12 at 11:41
    
Sorry, the current template is just producing one column of posts from various categories. I'd like to produce two columns of posts from various categories. –  a_knife_a_fork Nov 7 '12 at 12:50
    
What research effort have you made so far? What idea do you have and what route do you want to go? There're dozens of possible solutions ... see the tag archive for columns. –  kaiser Nov 7 '12 at 13:25
    
I have looked about and from what I've seen most tutorials / answers to questions deal with splitting the categories up in to respective columns. Other answers deal with taxonomies or complex solutions for themes like Twenty Ten which I can't relate to what I'm using. I have looked but I haven't really found anything. As for a route to go down I'd like to go down the simplest route possible but if there isn't one then I'll just have to go down the category A column, category B column. –  a_knife_a_fork Nov 7 '12 at 14:18
add comment

1 Answer

CSS3 to the rescue!

#articles-wrap, .span_9 {
      -moz-column-count: 2;
      -moz-column-gap: 10px;
      -moz-column-rule: none;
      -webkit-column-count: 2;
      -webkit-column-gap: 10px;
      -webkit-column-rule: none;
    column-count: 2;
    column-gap: 10px;
    column-rule: none;
    }
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.