This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
understrap/search.php

79 lines
1.7 KiB
PHP
Raw Normal View History

2014-12-10 11:36:38 +00:00
<?php
/**
2017-04-15 14:58:39 +00:00
* The template for displaying search results pages.
2014-12-10 11:36:38 +00:00
*
* @package understrap
*/
2019-06-20 08:57:12 +00:00
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
2018-09-10 21:59:04 +00:00
2017-04-15 14:58:39 +00:00
get_header();
2018-11-18 20:49:45 +00:00
$container = get_theme_mod( 'understrap_container_type' );
2017-11-27 04:10:48 +00:00
?>
2017-04-15 14:58:39 +00:00
<div class="wrapper" id="search-wrapper">
<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">
2017-04-15 14:58:39 +00:00
<div class="row">
<!-- Do the left sidebar check and opens the primary div -->
2017-10-27 02:45:44 +00:00
<?php get_template_part( 'global-templates/left-sidebar-check' ); ?>
2017-04-15 14:58:39 +00:00
<main class="site-main" id="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
2018-11-18 20:49:45 +00:00
<h1 class="page-title">
<?php
printf(
/* translators: %s: query term */
esc_html__( 'Search Results for: %s', 'understrap' ),
'<span>' . get_search_query() . '</span>'
);
?>
</h1>
2017-04-15 14:58:39 +00:00
</header><!-- .page-header -->
2014-12-10 11:36:38 +00:00
2017-04-15 14:58:39 +00:00
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
2014-12-10 11:36:38 +00:00
2017-04-15 14:58:39 +00:00
<?php
/**
* 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' );
?>
2014-12-10 11:36:38 +00:00
2017-04-15 14:58:39 +00:00
<?php endwhile; ?>
2014-12-10 11:36:38 +00:00
2017-04-15 14:58:39 +00:00
<?php else : ?>
2014-12-10 11:36:38 +00:00
2017-04-15 14:58:39 +00:00
<?php get_template_part( 'loop-templates/content', 'none' ); ?>
2014-12-10 11:36:38 +00:00
2017-04-15 14:58:39 +00:00
<?php endif; ?>
2017-04-15 14:58:39 +00:00
</main><!-- #main -->
2017-04-15 14:58:39 +00:00
<!-- The pagination component -->
<?php understrap_pagination(); ?>
2016-11-23 09:42:53 +00:00
2018-11-18 20:49:45 +00:00
<!-- Do the right sidebar check -->
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
2018-11-18 20:49:45 +00:00
</div><!-- .row -->
2018-11-18 20:49:45 +00:00
</div><!-- #content -->
2014-12-10 11:36:38 +00:00
2018-11-18 20:49:45 +00:00
</div><!-- #search-wrapper -->
2014-12-10 11:36:38 +00:00
2017-04-15 14:58:39 +00:00
<?php get_footer(); ?>