-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
46 lines (41 loc) · 1.25 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
<?php get_header(); ?>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<?php
$s=get_search_query();
$args = array(
's' =>$s
);
// The Query
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
_e("<h2 style='font-weight:bold;color:#000'>Search Results for: ".get_query_var('s')."</h2>");
while ( $the_query->have_posts() ) {
$the_query->the_post();
?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php
}
}else{
?>
</div>
</div>
<div class="row">
<div class="col-md-12 m-5">
<div id="notfound">
<div class="notfound">
<div class="notfound-404">
<h1>Oops!</h1>
<h2>404 - The Content did not found</h2>
</div>
<a href="<?php echo site_url();?>">Go TO Homepage</a>
</div>
</div>
</div>
</div>
<?php } ?>
<?php get_footer(); ?>
</div>