Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if (have_posts()) : ?>
- <?php $counter = 0; ?>
- <?php while (have_posts()) : ?>
- <?php the_post(); ?>
- <?php $counter++; ?>
- <?php $column = $counter % 4; ?>
- <?php $class = ( $column ) ? '<div class="threecol">' : '<div class="threecol last">';
- <?php if( $column == 1 ): // Open the Row?>
- <div class="row">
- <?php endif; ?>
- echo $class;
- <div id="post" <?php post_class(); ?>>
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- <?php if( has_post_thumbnail() ) the_post_thumbnail( 'thumbnail' ); ?>
- </div>
- </div>
- <?php if( !$column ): // Close the Row ?>
- </div>
- <div style="clear:both;"></div>
- <?php endif; ?>
- <?php endwhile; ?>
- <?php if( $column ) : //Finished on an odd number close Row ?>
- <div style="clear:both;"></div>
- <?php endif; ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement