-
Notifications
You must be signed in to change notification settings - Fork 13
/
search.php
77 lines (62 loc) · 1.33 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
<?php
/**
* The template for displaying search results pages.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package Suki
*/
// Prevent direct access.
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Header
*/
get_header();
/**
* Primary - opening tag
*/
suki_primary_open();
/**
* Hook: suki/frontend/before_main
*
* @hooked suki_content_header - 10
*/
do_action( 'suki/frontend/before_main' );
if ( have_posts() ) :
?>
<div id="loop" class="suki-loop suki-loop-search">
<?php
// Start the loop.
while ( have_posts() ) : the_post();
// Render post content using "content-search" layout on Customizer.
suki_get_template_part( 'entry', 'search' );
endwhile;
?>
</div>
<?php
else :
// Render not-found message.
$not_found_message = suki_get_theme_mod( 'search_results_not_found_text' );
if ( empty( $not_found_message ) ) {
$not_found_message = esc_html__( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'suki' );
}
echo wp_kses_post( wpautop( $not_found_message ) );
endif;
/**
* Hook: suki/frontend/after_main
*
* @hooked suki_archive_navigation - 10
*/
do_action( 'suki/frontend/after_main' );
/**
* Primary - closing tag
*/
suki_primary_close();
/**
* Sidebar
*/
get_sidebar();
/**
* Footer
*/
get_footer();