<?php
global $search_results_title, $search_results_nothing, $search_results_count;
/**
 * The template for displaying search results pages
 *
 */
get_header(); ?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">

			<header class="page-header">
				<?php if ( have_posts() ) : ?>
					<h1 class="page-title"><?php printf( $search_results_title, '<span>' . get_search_query() . '</span>' ); ?></h1>
					<?php
					if($search_results_count){
						global $wp_query;
						
					?>
						<div class="search-results-count"><?php echo $wp_query->found_posts.' '.$search_results_count; ?></div>
					<?php } ?>
				<?php else : ?>
					<h1 class="page-title"><?php echo $search_results_nothing; ?></h1>
				<?php endif; ?>
			</header>
		    
			<?php
			if ( have_posts() ) :
							
				get_template_part( 'loop' );
				
			else :
				
				global $coming_from_search;
				$coming_from_search = true;
				get_template_part( 'template-parts/content', 'none' );

			endif;
			?>

		</main>
	</div>
	<?php get_sidebar(); ?>

<?php get_footer();
