<?php
$columns = $columns_grid;
if( $columns == 1 ) {
  $col_layout = 12;
  $col_layout_class = "col-md-12";
  $equal_height_class = "";
} else if( $columns == 2 ) {
  $col_layout = 6;
  $col_layout_class = "col-xs-6 col-sm-6 col-md-6 col-lg-6";
  $equal_height_class = "equal-height";
} else if( $columns == 3 ) {
  $col_layout = 4;
  $col_layout_class = "col-xs-6 col-sm-6 col-md-6 col-lg-4";
  $equal_height_class = "equal-height";
} else if( $columns == 4 ) {
  $col_layout = 3;
  $col_layout_class = "col-xs-6 col-sm-4 col-md-4 col-lg-3";
  $equal_height_class = "equal-height";
} else { // else 6
  $col_layout = 2;
  $col_layout_class = "col-xs-6 col-sm-4 col-md-3 col-lg-2";
  $equal_height_class = "equal-height";
}
?>

<?php if ( $the_query->have_posts() ) : ?>
  <div class="tm-sc tm-sc-clients tm-sc-clients-grid <?php echo esc_attr(implode(' ', $classes)); ?>">
	<div class="row">
		<!-- the loop -->
		<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
		<div class="<?php echo esc_attr( $col_layout_class );?>">
			<?php include( 'common.php' ); ?>
		</div>
		<?php endwhile; ?>
		<!-- end of the loop -->
	</div>
  </div>
  <?php wp_reset_postdata(); ?>

<?php else : ?>
  <?php educacion_mascot_no_posts_match_criteria_text(); ?>
<?php endif; ?>