-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
141 lines (73 loc) · 2.95 KB
/
search.php
File metadata and controls
141 lines (73 loc) · 2.95 KB
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
132
133
134
135
136
137
138
139
140
141
<?php get_header(); ?>
<div id="content">
<div id="inner-content">
<?php get_sidebar(); ?>
<div id="main">
<div class="inner-wrap">
<?php
// loop starts
if ( have_posts() ) {
?>
<h1 class="archive-title">
Search for "<span class="search-query"> <?php echo get_search_query(); ?> </span>" returned these results:
</h1>
<?php
while ( have_posts() ) {
the_post();
?>
<article id="post-<?php the_ID(); ?>" class="post" role="article">
<header class="article-header">
<h2 class="post-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="byline">
<?php the_time('j F, Y'); ?>
</div>
</header> <!-- end article header -->
<section class="article-content">
<?php
if ( has_post_thumbnail() ) {
?>
<div class="featured-img">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('full-width'); ?></a>
</div>
<?php
}
the_excerpt();
?>
</section> <!-- end article section -->
<footer class="article-footer">
</footer> <!-- end article footer -->
</article> <!-- end article -->
<?php
} // end while
} // end if
else {
?>
<article id="post-not-found" class="post">
<header class="article-header">
<h1 class="not-found">Oops...</h1>
</header>
<section class="entry-content">
<p>Your search didn't return any results. Try again (with a diferent query...)</p>
<form method="get" id="search" action="<?php bloginfo('url'); ?>/">
<div id="searchform-2">
<input type="text" value="<?php the_search_query(); ?>" name="s" id="search-text-2" />
<input type="submit" id="search-submit-2" value="Search again" />
</div>
</form>
</section>
<footer class="article-footer">
</footer>
</article>
<?php
} //end else
// loop ends
?>
<div id="pagination">
<p><?php posts_nav_link(); ?></p>
</div>
</div> <!-- end #inner-wrap -->
</div> <!-- end #main -->
<?php get_sidebar(); ?>
</div> <!-- end #inner-content -->
</div> <!-- end #content -->
<?php get_footer(); ?>