Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $num_cols = 3; // set the number of columns here
- if (have_posts()) :
- for ( $i=1 ; $i <= $num_cols; $i++ ) :
- echo '<div id="col-'.$i.'" class="col">';
- $counter = $num_cols + 1 - $i;
- while (have_posts()) : the_post();
- if( $counter%$num_cols == 0 ) : ?>
- <div class="postarray">
- <a class="posttitle" title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
- <p class="meta"> <?php the_time('jS F Y') ?>//<?php the_category(', ') ?>//<?php the_author(); ?></p>
- <?php the_post_thumbnail(array(300,9999), array ('class' => 'alignleft')); ?>
- <p class="thumbtext"><?php the_excerpt(); ?> </p>
- <div class="clear"></div>
- </div>
- <?php endif; $counter++;
- endwhile;
- rewind_posts();
- echo '</div>'; //closes the column div
- endfor;
- endif; ?>
- <div class="clear"></div>
- STYLES FOR THIS:
- .postarray {width: 300px;height: auto;padding: 5px;border-bottom: solid 1px black;margin: 10px 0;float: left;display: block; }
- .col { width:310px; float:left; margin-left:20px; } /*adjust values*/
- #col-1.col { margin-left: 0; } /*optional*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement