<?php
/**
 * The template for displaying Search Results pages.
 *
 * @package shrk
 */

get_header(); ?>
<?php add_filter( 'shrk_show_sidebar', function () { return false; }); ?>

<div <?php echo apply_filters( 'shrk-page-cover-atts', 'page-cover' ); ?> >
	<header class="page-header">
		<?php if ( have_posts() ) : ?>
			<h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'ux-shop' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
		<?php else : ?>
			<h1 class="page-title no-results"><?php printf( esc_html__( 'No Results found for: %s', 'ux-shop' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
		<?php endif; ?>	
	</header><!-- .page-header -->
	<?php do_action( 'shrk-page-cover-after' ); ?>
</div>

<div class="container container-main-content">
	<div class="row">
		<div class="main-content-inner col-12 <?php echo esc_attr(shrk_get_main_inner_class()); ?>">            

			<?php if ( have_posts() ) : ?>

				<?php // start the loop. ?>
				<?php while ( have_posts() ) : the_post(); ?>

					<?php get_template_part( 'content', 'search' ); ?>

				<?php endwhile; ?>

				<?php shrk_content_nav( 'nav-below', 'container' ); ?>

			<?php else : ?>

				<?php get_template_part( 'no-results', 'search' ); ?>

			<?php endif; // end of loop. ?>

			<?php get_sidebar(); ?>

        </div><!-- close .*-inner (main-content or sidebar, depending if sidebar is used) -->
    </div><!-- close .row -->
</div><!-- close .container .container-main-content -->

<?php get_footer(); ?>