<?php get_header(); ?>
	<?php 
		$search_query = get_search_query(); 
		global $wp_query;
	?>

	<div class="content inner search searchpost">
		<div class="contentForm">
			<div class="container">
				<form id="searchResult" action="<?php bloginfo('url'); ?>" class="search-form" method="get">
					<input id="s" name="s" class="text" placeholder="Search" value="<?php echo $search_query; ?>">
					<input type="submit" class="submit" value="GO!">
					<button class="bt-clear">Clear</button>
				</form>
			</div>
		</div>
		<div class="contentResult">
			<div class="container">
				<h3 class="results-title success">Showing <?php echo $wp_query->found_posts; ?> results for: <span><?php echo esc_html(get_search_query(false)); ?></span></h3>
				<div class="linkpost">
					<span>Sort by</span>
					<a href="#popular" class="selected">Popular</a>
					<a href="#lastet">Latest</a>
					<a href="#oldest">Oldest</a>
				</div>
			</div>
		</div>
		<div class="addsMobile">
			<div class="addhome adds addhome1 tablet">
				<div class="contentAdd" style="background: #EF1366;"></div>
			</div>
			<div class="addhome adds mobile">
				<div class="contentAdd" style="background: #000;"></div>
			</div>
		</div>
		<div class="content-allposts">
			<div class="container">
				<div class="content-posts">
					<?php if (have_posts()) : ?>
						<div id="popular" class="blockPost view">
							<?php echo do_shortcode('[ajax_load_more post_type="post, page, offer" search="'. $search_query .'" orderby="relevance" posts_per_page="12" meta_key="post_views_count" meta_value="0" meta_compare=">=" orderby="meta_value_num" scroll="false" button_label="Load More" button_loading_label="Loading" loading_style="white" container_type="div"] ');?>
						</div>
						<div id="lastet" class="blockPost ">
							<?php echo do_shortcode('[ajax_load_more post_type="post, page, offer" search="'. $search_query .'" orderby="relevance" posts_per_page="12" scroll="false" button_label="Load More" button_loading_label="Loading" loading_style="white" container_type="div"] ');?>
						</div>
						<div id="oldest" class="blockPost ">
							<?php echo do_shortcode('[ajax_load_more post_type="post, page, offer" search="'. $search_query .'" order="ASC" orderby="relevance" posts_per_page="12" scroll="false" button_label="Load More" button_loading_label="Loading" loading_style="white" container_type="div"] ');?>
						</div>
					<?php else : ?>
						<h3 class="results-title error">nothing <span>"<?php echo esc_html(get_search_query(false)); ?>"</span> found.</h3>
					<?php endif; ?>
					<?php wp_reset_postdata(); wp_reset_query(); ?>
				</div>
				<div class="newsletterSearch">
					<h3>Our Today</h3>
					<h2>Subscribe to our<br> 
					Newsletter</h2>
					<p>Gain access to exclusive interviews</p>
					<?php //echo do_shortcode('[newsletter_form lists="2"]'); ?>

					<div class="tnp tnp-subscription">
						<form method="post" action="<?php bloginfo('url'); ?>/?na=s" onsubmit="return newsletter_check(this)">
							<input type="hidden" name="nlang" value="">
							<input type="hidden" name="nl[]" value="1">
							<div class="tnp-field tnp-field-email">
								<input class="tnp-email" type="email" name="ne" placeholder="Email" required>
							</div>
							<div class="tnp-field tnp-field-button"><input class="tnp-submit" type="submit" value="Go!" ></div>
						</form>
					</div>
					<span>By subscribing, you agree to our 
					<a href="#">Terms & Conditions</a> and <a href="#">Privacy Policy.</a></span>
				</div>
			</div><!-- .wrapper -->
		</div>
	</div><!-- .content.inner.blog -->

<?php get_footer(); ?>