WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Category posts as columns? (6 posts)

  1. vincepettit
    Member
    Posted 5 years ago #

    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

  2. vincepettit
    Member
    Posted 5 years ago #

    Anyone?

  3. Mark / t31os
    Moderator
    Posted 5 years ago #

    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...

  4. vincepettit
    Member
    Posted 5 years ago #

    Cheers for that... i'll probably give that a go for now!

  5. vincepettit
    Member
    Posted 5 years ago #

    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 *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    *        * *        * *        * *        *
    ********** ********** ********** **********
  6. Mark / t31os
    Moderator
    Posted 5 years ago #

    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... ;)

Topic Closed

This topic has been closed to new replies.

About this Topic