-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
54 lines (49 loc) · 979 Bytes
/
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
<?php
get_header();
?>
<div class="warn">
Attention: this is from search.php
</div>
<h2>Search Results: <?php echo get_search_query(); ?> </h2>
<?php
if( have_posts() ){
while( have_posts() ){
the_post();
?>
<article class="post">
<h2>
<a href="<?php the_permalink();?>">
<?php the_title();?>
</a>
</h2>
<p class="post-info">
<?php the_time("F j, D Y g:i a"); ?>
|
<a href="<?php echo get_author_posts_url(get_the_author_meta('ID')) ?>">
<?php the_author(); ?>
</a>
|
<?php
$cats = get_the_category();
foreach ($cats as $c) {
$link = get_category_link($c->term_id);
echo "<a href='$link'>";
echo $c->name;
echo "</a>,";
}
?>
</p>
<?php the_post_thumbnail("xlarge"); ?>
<?php the_excerpt(); ?>
<a class="read-more" href="<?php the_permalink(); ?>">
Read more ->
</a>
</article>
<?php
}
}
else{
echo "No content found";
}
get_footer();
?>