This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
search.php
113 lines (110 loc) · 3.23 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
<?php get_header(); ?>
<div class="content">
<div class="content-heading">
<div class="container">
<div class="row">
<div class="col-lg-6 col-lg-push-3 col-sm-10 col-sm-push-1">
<form role="search" method="get" action="<?php echo home_url( '/' ); ?>">
<div class="media">
<div class="media-object pull-left">
<label class="form-icon-label"><span class="icon">search</span></label>
</div>
<div class="media-inner">
<input class="form-control" type="search" placeholder="Entry keyword..." value="<?php echo get_search_query() ?>" name="s" style="color:#FFFFFF;">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container">
<div class="card-wrap">
<div class="row">
<?php
if( have_posts() ){
?>
<div class="tile-wrap">
<div class="tile">
<div class="pull-left tile-side">
<div class="avatar avatar-sm">
<i class="fa fa-search"></i>
</div>
</div>
<div class="tile-inner">
This is a page search : <?php echo get_search_query(); ?>
</div>
</div>
</div>
<?php
while( have_posts() ){ the_post();
if($post->post_type == "page") continue;
get_template_part('content');
}
?>
<div class="row">
<div class="col-md-6">
<span class="pull-left"><?php previous_posts_link(); ?></span>
</div>
<div class="col-md-6">
<span class="pull-right"><?php next_posts_link(); ?></span>
</div>
</div>
<?php } else { ?>
<div class="container" style="text-align:center;">
<p><i class="mdi-action-room"></i> Not Found</p>
</div>
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-main">
<div class="card-inner">
<p class="card-heading">Recent Post</p>
<p>
<?php
$query = new WP_Query( array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => '3'
) );
while( $query->have_posts() ){ $query->the_post();
?>
<p><a href="<?php the_permalink();?>"><b><?php the_title();?></b></a><br>
<i><?php echo get_the_excerpt(); ?></i></p>
<?php } ?>
</p>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-main">
<div class="card-inner">
<p class="card-heading">Pages</p>
<p><ul>
<?php
$query = new WP_Query( array(
'post_type' => 'page',
'post_status' => 'publish',
'orderby' => 'name',
'order' => 'ASC'
) );
while( $query->have_posts() ){ $query->the_post();
?>
<li><a href="<?php the_permalink();?>" class="list-group-item-heading"><?php the_title();?></a></li>
<?php } ?>
</ul></p>
</div>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>