<?php
/**
* The loop to show posts in columns
* loop-grid.php
* Grid style page template with Nivo Slider
*/
?>
<?php /* Start the Loop */ ?>
<?php $num_cols = 4; // set the number of columns here
for ( $i=1 ; $i <= $num_cols; $i++ ) :
echo '<div class="column col-' . $i . '" >';
$counter = $num_cols + 1 - $i; ?>
<?php while (have_posts()) : the_post();
if( $counter%$num_cols == 0 ) :
// begin of core posts output ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
</header><!-- .entry-header -->
<div class="portfolio-thumb">
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyetwelve' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_post_thumbnail('portfolio-thumbnail', 'class=alignleft'); ?></a>
</div>
<div class="entry-summary">
<?php echo get_the_portfolio_excerpt(); ?>
</div><!-- .entry-summary -->
</article><!-- #post -->
<?php //end of posts output
endif; $counter++;
endwhile;
rewind_posts();
echo '</div>'; //closes the column div
endfor; ?>
<?php /* Display navigation or wp-PageNavi if installed */ ?>
<?php if ( $wp_query->max_num_pages > 1 || get_query_var('page')) : ?>
<?php twentytwelve_content_nav( 'nav-below' ); ?>
<?php endif;
wp_reset_query(); ?>