-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
61 lines (56 loc) · 1.65 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
<?php
defined( 'ABSPATH' ) or die();
/**
* Search template
*
* @link https://developer.wordpress.org/themes/basics/template-files/#common-wordpress-template-files
* @package Vulpix
* @since Vulpix 1.0.0
*/
get_header();
?>
<main role="main" class="container">
<div class="grid">
<h1 class="col-12 --center">
<?php
printf(
// translators: %s: search term.
esc_html__( 'Results for "%s"', 'vulpix' ),
'<span class="page-description search-term">' . esc_html( get_search_query() ) . '</span>'
);
?>
</h1>
<div class="search-result-count default-max-width">
<?php
printf(
esc_html(
// translators: %d: the number of search results.
_n(
'We found %d result for your search.',
'We found %d results for your search.',
(int) $wp_query->found_posts,
'vulpix'
)
),
(int) $wp_query->found_posts
);
?>
</div>
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
// Get post list template
get_template_part( 'template-parts/content/template', 'post-list' );
}
// Get pagination
vpx_the_posts_navigation();
} else {
// If no content
get_template_part( 'template-parts/content/template', 'none' );
}
?>
</div>
</main>
<?php
get_footer();