<?php
/*
 * Template file for posts shortcode.
 * $temptt_t_vars is an array of custom parameters set for given post shortcode.
 */

empty($temptt_t_vars['temptt_var1']) || $temptt_t_vars['temptt_var1'] == 'default' ? $bt_cols='4' : $bt_cols = $temptt_t_vars['temptt_var1'];
?>
<div class="tt-posts tt-posts-default-loop blog-area ">
<div class="row">
	<?php
		// Posts are found
		if ( $posts->have_posts() ) {
			while ( $posts->have_posts() ) :
				$posts->the_post();
				global $post;
				?>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<div class="single-blog-post">
					    <?php if ( has_post_thumbnail() ) : ?>
							<div class="img-box">
						        <a class="news_img" href="<?php the_permalink(); ?>"><?php the_post_thumbnail('ranbron-blogsmall'); ?></a>
								<div class="date-box"><?php the_time( get_option( 'date_format' ) ); ?></div><!-- /.date-box -->
							</div><!-- /.img-box -->
					    <?php endif; ?>
						<?php the_title( sprintf( '<a href="%s" rel="bookmark"><h3 class="page-title">', esc_url( get_permalink() ) ), '</h3></a>' ); ?>
						<p><?php ranbron_tt_excerpt_charlength('130'); ?></p>
						<a class="read-more" href="<?php the_permalink(); ?>"><?php esc_html_e('Read More', 'ranbron'); ?></a>
					</div><!-- /.single-blog-post -->
				</div>

				<?php
			endwhile;
		}
		// Posts not found
		else {
			echo '<h4>' . esc_html__( 'Posts not found', 'ranbron' ) . '</h4>';
		}
	?>
</div>
</div>
