-
Notifications
You must be signed in to change notification settings - Fork 5
/
search.php
91 lines (90 loc) · 2.63 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
<?php get_header(); ?>
<div class="content-page">
<!-- Start content -->
<div class="content">
<div class="container">
<?php
if( have_posts() ){
?>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-search"></i> This is a page search : <?php echo get_search_query(); ?></h3>
</div>
<div class="panel-body">
<div class="grid-structure">
<div class="row">
<?php
while( have_posts() ){ the_post();
if($post->post_type == "page") continue;
get_template_part('template/gut-content', get_post_format());
}
?>
</div>
</div>
</div>
</div>
<?php
the_posts_pagination( array(
'prev_text' => __( 'Back', 'textdomain' ),
'next_text' => __( 'Next', 'textdomain' ),
'screen_reader_text' => __("")
) );
?>
<?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>
<?php footer_x();?>
</div>
<?php get_footer(); ?>