-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
60 lines (45 loc) · 1.58 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
<?php
/**
* Search template.
*
* @package Edrea
*
* @version 1.0.0
* @copyright Copyright (c) 2023, Leonardo Doherty
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*
*/
$args = array(
'prev_text' => __( 'Older', 'edrea' ),
'next_text' => __( 'Newest', 'edrea' ),
'screen_reader_text' => __( 'Posts navigation', 'edrea' ),
'aria_label' => __( 'Posts', 'edrea' ),
'class' => 'posts-navigation',
);
if( isset( $_GET['s'] ) ) {
$inputUser = esc_html( $_GET['s'] );
}
get_header(); ?>
<main id="primary" class="edrea-archive-blog">
<div class="container">
<?php printf( __("<h2 class='edrea-input-search'>Search for <span>%s</span> :</h2>", 'edrea'), $inputUser ); ?>
<?php if ( have_posts() ) :
?>
<div id="edrea-ajax-wrapper" class="edrea-archive-blog__wrapper edrea-masonry">
<?php
/* Start the Loop */
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content', get_post_type() );
endwhile;
?>
</div>
<?php
else :
get_template_part( 'template-parts/content', 'empty' );
endif;
?>
<?php the_posts_navigation( $args ); ?>
</div>
</main>
<?php get_footer(); ?>