This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch.php
74 lines (63 loc) · 1.93 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* Search Template
*
* The template for displaying search results.
*
* @package HrswpTheme
* @since 1.0.0
*/
use HrswpTheme\components\navigation;
get_header();
?>
<main id="wsuwp-main" class="spine-search-index">
<?php
if ( have_posts() ) {
global $wp_query;
?>
<header class="page-header">
<h1>
<?php esc_html_e( 'Search results for: ', 'hrswp-theme' ); ?>
<span class="search-query"><?php echo get_search_query(); ?></span>
</h1>
<span class="meta">Found about <?php echo esc_html( absint( $wp_query->found_posts ) ); ?> results.</span>
</header>
<section class="row single gutter pad-bottom">
<div class="column one">
<div class="notification--light">
<p>Didn't find what you were looking for? <a target="_blank" rel="noopener noreferrer" class="button--flat" href="https://search.wsu.edu/">Try the WSU site search → <span class="screen-reader-text">(Link opens in a new window.)</span></a></p>
</div>
<div class="articles-list">
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'build/templates/archive' );
endwhile;
?>
</div>
</div><!--/column-->
</section>
<?php
navigation\render();
} else {
?>
<header class="page-header">
<h1>
<?php esc_html_e( 'No search results for:', 'hrswp-theme' ); ?>
<span class="search-query"><?php echo get_search_query(); ?></span>
</h1>
</header>
<section class="row single gutter pad-ends article-archive">
<div class="column one">
<div class="notification--light">
<p>Didn't find what you were looking for? <a target="_blank" rel="noopener noreferrer" class="button--flat" href="https://search.wsu.edu/">Try the WSU site search → <span class="screen-reader-text">(Link opens in a new window.)</span></a></p>
</div>
</div><!--/column-->
</section>
<?php
}
get_template_part( 'build/templates/footer' );
?>
</main><!--/#page-->
<?php
get_footer();