<?php
/**
 * The template for displaying search results pages
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
 *
 * @package News_Viral
 */

get_header(); ?>
	<div class="container padding-none">
		<div class="row">

			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">	
			<?php
			if ( have_posts() ) : ?>
				<header class="page-header">
					<?php get_search_form(); ?>
					<h4>
					 	<?php esc_html_e('Search results for :', 'news-viral'); echo get_search_query();  ?>
					</h4>
				</header><!-- .page-header -->
				<div class="row">						
					<div class="memory_block_search">					
					<?php $icounter=1;	 global $wp_query;					 
					while ( have_posts() ) : the_post(); 
					 
						$icounter=($icounter>2)?1:$icounter;  ?>
			            <div class="col-md-6 col-sm-6 col-xs-12">
							<?php  get_template_part( 'template-parts/content', 'search' ); ?>
			            </div>
		            	<?php if($icounter==2 || $wp_query->current_post+1 == $wp_query->post_count):?>
							<div class="clearfix">	</div>
						<?php endif; 
					 	$icounter++; endwhile; ?>
					</div>
	            </div>
				<?php	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' ),
					) );
			else :
				get_template_part( 'template-parts/content', 'none' );
			endif; ?>
		</div><!-- #main -->
		</div>
	</div><!-- #primary -->
<?php  get_footer();