This repository was archived by the owner on Nov 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsearch.php
82 lines (74 loc) · 1.69 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
75
76
77
78
79
80
81
82
<?php
/**
* The template for displaying search results pages.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package Marianne
* @since Marianne 1.0
*/
get_header();
?>
<div id="content" class="site-content">
<main id="primary" class="site-primary" role="main">
<?php if ( have_posts() ) : ?>
<header class="archive-header">
<h1 class="page-title">
<?php
printf(
/* translators: %s: search term. */
esc_html__( 'Search for "%s"', 'marianne' ),
esc_html( get_search_query() )
);
?>
</h1>
<div class="archive-description">
<p>
<?php
printf(
esc_html(
/* translators: %d: the number of search results. */
_nx(
'%d result found:',
'%d results found:',
(int) $wp_query->found_posts,
'Search results',
'marianne'
)
),
(int) $wp_query->found_posts
);
?>
</p>
</div>
</header>
<?php
while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/content', 'loop' );
}
marianne_loop_navigation();
?>
<?php else : ?>
<header class="archive-header">
<h1 class="page-title">
<?php
printf(
/* translators: %s: search term. */
esc_html__( 'Search for "%s"', 'marianne' ),
esc_html( get_search_query() )
);
?>
</h1>
</header>
<article <?php post_class( 'entry-page' ); ?>>
<section class="entry-content page-content">
<p><?php esc_html_e( 'This search did not return any results.', 'marianne' ); ?></p>
</section>
</article>
<?php endif; ?>
</main>
</div>
<?php
get_sidebar();
get_footer();