<?php $mediapulse_blog_layout = get_theme_mod( 'blog_layout', "right" );
if( $mediapulse_blog_layout == "left" ) : ?>
<div class="col-lg-4 pt-3 pt-lg-0">
	<?php get_sidebar('sidebar-primary'); ?>
</div>
<?php endif; 
if ( $mediapulse_blog_layout == "full" ) {
	$mediapulse_div = "12";
} else {
	$mediapulse_div = "8";
} ?>
<div class="col-lg-<?php echo $mediapulse_div; ?>">
	<div class="row">
		<?php if ( have_posts()): 
		while ( have_posts() ): the_post(); ?>
		<div class="col-lg-6">
			<div class="position-relative mb-3">
				<?php if ( has_post_thumbnail() ) :
						the_post_thumbnail(); endif; ?>
				<div class="overlay position-relative bg-light">
					<div class="mb-2" style="font-size: 14px;">
						<?php the_category( ' , ' ); ?>
						<span class="px-1"><?php esc_html_e('/','mediapulse'); ?></span>
						<span><?php echo esc_html( get_the_date() ); ?></span>
					</div>
					<a class="h4" href="<?php echo esc_url( get_permalink() ); ?>"><?php the_title(); ?></a>
					<p class="m-0">
<?php
							$excerpt_len = get_theme_mod('excerpt_len', '300');
							$excerpt = get_the_excerpt();
							$excerpt = substr( $excerpt , 0, $excerpt_len); 
							echo $excerpt; ?>
					</p>
				</div>
			</div>
		</div>
		<?php endwhile; endif; ?>
		<?php wp_reset_postdata(); ?>
	</div>

	<?php the_posts_pagination( array( 'mid_size' => 2 ) ); ?>

</div>

<?php if( $mediapulse_blog_layout == "right" ) : ?>
<div class="col-lg-4 pt-3 pt-lg-0">
	<?php get_sidebar('sidebar-primary'); ?>
</div>
<?php endif; ?>