<?php
/**
 * The template for displaying search results pages
 *
 * @package Wrock Metro
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

get_header();

$container = get_theme_mod( 'wrockmetro_container_type' );
$postsstyle = get_theme_mod( 'wrockmetro_posts_layout', 'liststyle');

?>
<div class="wrapper" id="search-wrapper">

	<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">

		<div class="row">

			<?php
			// Do the left sidebar check and open div#primary.
			get_template_part( 'global-templates/left-sidebar-check' );
			?>
			<main class="site-main" id="main">
			<?php 
				if (is_active_sidebar('serach-before-posts')) {
					dynamic_sidebar('serach-before-posts');
				} ?>			
				<?php get_template_part( 'loop-templates/posts/posts', $postsstyle ); ?>
			</main>
			<?php
			// Display the pagination component.
			wrockmetro_pagination();

			// Do the right sidebar check and close div#primary.
			get_template_part( 'global-templates/right-sidebar-check' );
			?>

		</div><!-- .row -->

	</div><!-- #content -->

</div><!-- #search-wrapper -->

<?php
get_footer();
