-
Notifications
You must be signed in to change notification settings - Fork 1
/
search.php
executable file
·131 lines (107 loc) · 3.09 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php get_header();
$search_term = $_GET['term'];
?>
<body>
<style type="text/css" media="screen">
.displayResult{
font-size: 16px;
padding: 12px;
color: #99CFBD;
}
.post-title h4{
font-size: 22px;
padding: 5px 0;
}
.post-excerpt p{
font-size: 16px;
}
.section_wrapper{
width: 80%;
margin: auto;
}
.result{
background: white;
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.53);
margin-bottom: 20px;
padding: 20px;
}
.pagination{
margin:10px;
}
.page-numbers{
padding: 5px 7px;
background: white;
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.53);
}
.page-numbers.current{
background: #93CFBD;
color: white;
}
</style>
<?php get_template_part( 'nav/init' ); ?>
<main>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
's' => $s,
'paged' => $paged,
);
$allsearch = new WP_Query($args);
$count = $allsearch->post_count;
$startpost = 10*($paged - 1)+1;
$endpost = (10*$paged < $wp_query->found_posts ? 10*$paged : $wp_query->found_posts);
wp_reset_query(); ?>
<div id="Content">
<div class="content_wrapper clearfix">
<!-- .sections_group -->
<div class="sections_group" style="width:100% !important;">
<div class="section">
<div class="section_wrapper clearfix">
<div class="column one column_blog">
<div class="blog_wrapper isotope_wrapper classic">
<h2 class="displayResult">Showing results <?php echo $startpost; ?> - <?php echo $endpost; ?> of <?php echo $wp_query->found_posts; ?></h2>
<div class="posts_group">
<?php
while ( $allsearch->have_posts() )
{
$allsearch->the_post();
?>
<div id="post-<?php the_ID(); ?>" class="result" >
<div class="post-desc-wrapper">
<div class="post-desc">
<div class="post-title">
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
</div>
<div class="post-excerpt">
<?php the_excerpt(); ?>
</div>
<div class="post-meta">
<!--
<div class="author">by
<a href="<?= get_author_posts_url( get_the_author_meta( 'ID' ) ) ?>"><?= get_the_author_meta( 'display_name' ) ?></a></div>
-->
<!-- <div class="date"><?= get_the_date() ?></div> -->
<hr class="hr_narrow hr_left" />
</div>
<div class="post-footer">
<a href="<?php echo get_permalink() ?>" class="btn primary post-more">readmore</a>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
<div class="pagination">
<?php echo paginate_links(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<?php get_footer(); ?>