-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
55 lines (33 loc) · 1.57 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
<?php get_header(); ?>
<main class="main pageBlog pageArchive" id="main" role="main">
<?php if (have_posts()) : ?>
<div class="archive-title contain">
<p>Search results</p>
<?php get_search_form(); ?>
</div>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php while (have_posts()) : the_post(); ?>
<article class="blogPost">
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<div class="featuredImage"
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>
style="background-image: url('<?php echo $image[0]; ?>');">
</div>
<?php endif; ?>
<div class="postInfo">
<h1 class="postTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<h2 class="date"><time datetime="<?php the_time('Y-m-d'); ?>"><?php the_time('jS F Y'); ?></time></h2>
<?php the_excerpt(); ?>
<p class="theTags"><?php the_tags(' ', ' × ', ''); ?></p>
</div>
</article>
<?php endwhile; ?>
<?php include (TEMPLATEPATH . '/_/parts/pagination.php' ); ?>
<?php else: ?>
<div class="archive-title contain">
<p>No results found for ‘<?php echo get_search_query(); ?>’</p>
<?php get_search_form(); ?>
</div>
<?php endif ?>
</main>
<?php get_footer(); ?>