<?php
/*
Theme Name : News Viral
Text Domain : news-viral
*/
get_header(); ?>
<div class="container padding-none">
<!-- Main -->
	<div class="row">
		<?php
		 $blog_layout_class=(get_theme_mod('blog_sidebar_style','right_sidebar') == 'left_sidebar')?"8":((get_theme_mod('blog_sidebar_style','right_sidebar') == 'right_sidebar')?"8":"12");
		 if(get_theme_mod('blog_sidebar_style','right_sidebar')=='left_sidebar'){ ?>
		<!-- Left sidebar -->
		<div class="col-md-4 col-sm-4 col-xs-12">
			<div class="<?php echo esc_attr(get_theme_mod('blog_sidebar_style')); ?> text-center">
	        	<?php get_sidebar(); ?>		
	        </div>
		</div> <!-- and Left sidebar -->
		<?php } ?>
		<!-- content -->
		<div class="col-md-<?php echo esc_attr($blog_layout_class); ?> col-sm-8 col-xs-12">	
			
			<div class="memory_block">
				<?php 
				$icounter=1; while ( have_posts() ) : the_post(); 
				$icounter=($icounter>2)?1:$icounter; ?>
				<div class="col-md-6 col-sm-6 col-xs-12 <?php echo esc_attr($icounter);?>">
					<?php
						get_template_part( 'template-parts/content', 'blog' );
						// If comments are open or we have at least one comment, load up the comment template.
					?> 
				</div>
				<?php if($icounter==2):?>
					<div class="clearfix">
					</div>
				<?php endif; ?>
				<?php $icounter++;
					endwhile; // End of the loop.
					the_posts_pagination( array(
					    'prev_text' => __( '<i class="fa fa-arrow-left" aria-hidden="true"></i>', 'news-viral' ),
					    'next_text' => __( '<i class="fa fa-arrow-right" aria-hidden="true"></i>', 'news-viral' ),
					) ); 
				?>
			</div>
		</div><!-- and content -->
		<?php if(get_theme_mod('blog_sidebar_style','right_sidebar')=='right_sidebar'){ ?>
        <!-- right sidebar -->
		<div class="col-md-4 col-sm-4 col-xs-12">
			<div class=" text-center">
	        	<?php get_sidebar(); ?>		
	        </div>
		</div> <!-- and right sidebar -->
		<?php } ?>
    </div><!-- and Main  -->
</div>
<?php 
get_footer();