<?php
/**
 * The template for displaying search results pages
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
 *
 * @package Canyon Themes
 * @subpackage Sewa
 */
get_header();
$sewa_designlayout      = sewa_get_option( 'sewa_sidebar_layout_option' );
$sidebardesignlayout =  $sewa_designlayout;
 ?>    
    <section id="inner-title" class="inner-title" >
        
        <div class="container">
        
            <div class="row">
        
                <div class="col-md-8">
        
                    <h2><?php printf(esc_html__('Search Results for: %s', 'sewa'), '<span>' . get_search_query() . '</span>'); ?></h2>
        
                </div>
            </div>
        </div>
    </section>
<?php 
	$sidebar_primary_classes_alignment =  '' ;
	if ( $sidebardesignlayout == 'left-sidebar') { 
		$sidebar_primary_classes_alignment =  ' order-md-2' ;

	}
?>
    <section class=" section-margine gray-bg">
        <div class="container">
            <div class="row">
                <div class="col-sm-12 col-md-<?php if ($sewa_designlayout == 'no-sidebar') {
                    echo "12";
                } else {
                    echo "8";
                } echo $sidebar_primary_classes_alignment; ?> left-block">
                    <?php
                    if (have_posts()) : ?>

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

                            /**
                             * Run the loop for the search to output the results.
                             * If you want to overload this in a child theme then include a file
                             * called content-search.php and that will be used instead.
                             */
                            get_template_part('template-parts/content', 'search');

                        endwhile;

                        the_posts_navigation();

                    else :

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

                    endif; ?>

                </div><!-- div -->
                <?php 
				$sidebar_classes_alignment =  '' ;
				if ( $sidebardesignlayout == 'left-sidebar') { 
					$sidebar_classes_alignment =  'order-md-1' ;
				 
				}
				
				if ($sewa_designlayout != 'no-sidebar') { ?>
               
                    <div class="col-sm-12 col-md-4 <?php echo $sidebar_classes_alignment; ?>">
                        <?php get_sidebar(); ?>
               
                    </div>
               
                <?php } ?>
            </div><!-- div -->
        </div>
    </section>

<?php get_footer();
