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

get_header(); ?>
<section class="c-sections online_store_main_content">
        <div class="container">
            <div class="row">
                <div class="<?php echo yahosein_main_sidebar_class(); ?>">
	<section id="primary" class="content-area">
		<main id="main" class="site-main " role="main">
	<ul class="carousel-inner">
		<?php
		if ( have_posts() ) : ?>

			<header class="page-header">
				<h1 class="page-title"><?php echo 'نتایج جستجو برای : <span class="searched_term">"' . esc_html(get_search_query()) . '"</span>' ; ?></h1>
			</header><!-- .page-header -->

			<?php
			/* Start the Loop */
			while ( have_posts() ) : the_post();

					get_template_part( 'template-parts/content', 'search' );

			endwhile;
			echo '<div class="posts_bottom_nav pagination pagination-centered">';
			if(function_exists('wp_pagenavi')):
				wp_pagenavi();
			else:
				the_posts_navigation();
			endif;
			echo '</div>';

		else :

			get_template_part( 'template-parts/content', 'none' );

		endif; ?>
		</ul>
		</main><!-- #main -->
	</section><!-- #primary --></div>
	<?php get_sidebar(); ?>
	</div></div></section>

<?php
get_footer();
