-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
30 lines (27 loc) · 1.05 KB
/
search.php
File metadata and controls
30 lines (27 loc) · 1.05 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
<?php use Roots\Sage\Extras; ?>
<section class="page-header">
<h1 class="page-header__title"><span class="page-title">Search Results</span></h1>
<a class="page-header__back-button" href="<?= Extras\back_link() ?>" aria-label="Go back to previous page" tabindex="0">Back</a>
</section>
<section class="page-header">
<span class="section-number"><i class="icon-search"></i></span>
<?php get_search_form(); ?>
</section>
<section class="page-content">
<div class="article-list">
<?php if(have_posts()): ?>
<?php $count = count($wp_query->posts); ?>
<?php while (have_posts()): the_post(); ?>
<article class="article-item">
<h2 class="article-item__title"><a href="<?= get_the_permalink() ?>"><?php the_title(); ?></a></h2>
<h3 class="article-item__date"><?php the_time("d M Y"); ?></h2>
<?php the_excerpt(); ?>
</article>
<?php endwhile; ?>
<?php else: ?>
<div class="article-item">
<p>Sorry, no results were found.</p>
</div>
<?php endif; ?>
</div>
</section>