• Resolved vincepettit

    (@vincepettit)


    Probably a simple one…but I was wondering how I would go about displaying one of my category post pages as columns

    So for example …

    ********** ********** ********** **********
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    * Post 1 * * Post 2 * * Post 3 * * Post 4 *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    ********** ********** ********** **********

    Rather than having the posts display down the page

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter vincepettit

    (@vincepettit)

    Anyone?

    If you want consistent heights across the columns you’d use a table, until the big browsers and users have browsers that support proper CSS columns.

    Where you have you while loop you use columns instead of divs, you can do what you like inside the columns…

    You replace the post div with a table column, making sure you open the table before the loop…

    So let’s say this was the start of your loop code..

    <?php while (have_posts()) : the_post();  ?>
    	<div <?php if(function_exists('post_class')) post_class();?>>

    You’d replace that with something like..

    <table class="somename"><tr>
    <?php while (have_posts()) : the_post();  ?>
    	<td <?php if(function_exists('post_class')) post_class();?>>

    Of course making sure to use the appropriate closing tags to….

    It’s a crude example, but it gets straight to the point…

    You can of course leave out the post class included in the example if you so choose and just add your own etc…

    Thread Starter vincepettit

    (@vincepettit)

    Cheers for that… i’ll probably give that a go for now!

    Thread Starter vincepettit

    (@vincepettit)

    I think that’s working now… but here’s another question… is it possible to have 2 rows of columns, so it would be…

    ********** ********** ********** **********
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    * Post 1 * * Post 2 * * Post 3 * * Post 4 *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    ********** ********** ********** **********
    
    ********** ********** ********** **********
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    * Post 5 * * Post 6 * * Post 7 * * Post 8 *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    ********** ********** ********** **********

    You could alternatively use some CSS to float elements, to avoid using tables, but several columns later it’ll likely break and have inconsistent display across browsers…

    Be sure to make the topic resolved if the question is answered… 😉

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Category posts as columns?’ is closed to new replies.