-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
82 lines (64 loc) · 2.73 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
<?php
/**
* The template for displaying Search Results pages
*
* @package WordPress
* @subpackage WpStrap
* @since wpstrap 1.0
*/
get_header(); ?>
<!--Custom codes goes here-->
<?php // Get number of results
$results_count = $wp_query->found_posts;
?>
<header class="well">
<div class="container">
<?php olaw2jr_breadcrumbs(); ?>
</div>
</header>
<div class="container">
<h1>Search <span class="keyword">“<?php the_search_query(); ?>”</span></h1>
<?php if ($results_count == '' || $results_count == 0) { // No Results ?>
<p><span class="label label-danger"><?php _e('No Results'); ?></span> <?php _e('Try different search terms.'); ?></p>
<?php } else { // Results Found ?>
<p><span class="label label-success"><?php echo $results_count . __(' Results'); ?></span></p>
<?php } // end results check ?>
<div class="row">
<div class="col-md-3">
<?//php get_search_form(); ?>
</div>
</div>
</div> <!-- .container -->
<div class="container">
<div class="row">
<div class="col-md-8">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentythirteen' ), get_search_query() ); ?></h1>
</header><!-- .Search Results -->
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="media">
<a class="pull-left hidden-xs" href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('archives'); ?>
</a>
<div class="media-body">
<h4 class="media-heading"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<p class="entry-meta">
<small>
<i class="fa fa-user"></i> <?php the_author_posts_link(); ?>
<i class="fa fa-clock-o"></i> <?php the_time('F d, Y'); ?>
</small>
</p>
<?php the_excerpt(); ?>
</div>
</div>
<hr>
<?php endwhile; else: ?>
<p><span class="label label-danger"><?php _e('No Results'); ?></span> <?php _e('Try different search terms.'); ?></p>
<?php endif; ?>
</div><!-- /col-md-8 -->
<?php get_sidebar(); ?>
</div><!-- /row -->
</div>
<?php get_footer(); ?>