-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
executable file
·49 lines (33 loc) · 854 Bytes
/
search.php
File metadata and controls
executable file
·49 lines (33 loc) · 854 Bytes
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
<?php
/**
* The template for displaying search results pages.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package Withdesign
*/
get_header(); ?>
<main class="row column">
<?php
if ( have_posts() ) : ?>
<?php
printf( '<h1>Search Results for: %s</h1>',
esc_html( get_search_query() )
);
while ( have_posts() ) :
the_post();
the_title('<h2>', '</h2>');
the_excerpt();
printf( '<a href="%s" class="button">Read More</a>',
esc_url( get_the_permalink() )
);
endwhile;
the_posts_navigation();
else :
printf( 'Sorry, no results for %s',
esc_html( get_search_query() )
);
endif; ?>
</main>
<?php
get_footer();