search.php 2.5 KB
<?php
/**
 * The template for displaying search results pages
 *
 * @package Understrap
 */

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

get_header();

?>

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

	<div class="<?php echo esc_attr( $container ); ?> container search-content" id="content" tabindex="-1">
		<h1 class="sh1"><?php _e("Search results for:", 'msf'); ?></h1>
			<?php //get_search_form() ?>
			<?php echo do_shortcode('[searchandfilter slug="top-search"]'); echo do_shortcode('[advance-search search_id="399"]'); ?>
			<button class="btn btn-primary filter" data-bs-toggle="collapse"  data-bs-target="#search-sidebar" role="button" aria-expanded="false" aria-controls="search-sidebar" >
				<?php _e("SORT AND FILTER", 'msf'); ?>
					</button>
			<div class="search-wrapper row">
		
			<div class="col-sm-12 col-md-12 col-lg-3 widget-area collapse" id="search-sidebar">
					<?php echo do_shortcode('[searchandfilter slug="search"]'); ?>
					<button class="btn btn-primary filter apply-filters" data-bs-toggle="collapse"  data-bs-target="#search-sidebar" role="button" aria-expanded="false" aria-controls="search-sidebar" >
					<?php _e("APPLY FILTERS", 'msf'); ?>
					</button>
			</div>
			<main class="col-sm-12 col-md-9 content-area site-main search-result" id="main">
				
			<?php echo do_shortcode('[searchandfilter id="112" action="filter_next_query"]'); ?>
				<?php if ( have_posts() ) : 
					         global $wp_query; 
							 
					
					?>

					<header class="page-header">

							<h3 class="page-title">
								<?php
								printf(
									/* translators: %s: query term */
									esc_html__( 'SHOWING: %s', 'understrap' ),
									'<span>' .$wp_query->found_posts. '</span>'
								);
								?>
							</h3>

					</header><!-- .page-header -->

					<?php /* Start the Loop */ ?>
					<?php
					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( 'loop-templates/content', 'search' );
					endwhile;
					?>

				<?php else : ?>

					<?php get_template_part( 'loop-templates/content', 'none' ); ?>

				<?php endif; ?>
				<?php understrap_pagination(); ?>
			</main><!-- #main -->

			<!-- The pagination component -->
		
			</div>
			
			<!-- The pagination component -->
		



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

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

<?php
get_footer();