-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch.php
31 lines (26 loc) · 911 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
<?php theme_include('header'); ?>
<h1 class="wrap">You searched for “<?php echo search_term(); ?>”.</h1>
<?php if(has_search_results()): ?>
<ul class="items">
<?php $i = 0; while(posts()): $i++; ?>
<li style="background: hsl(215,28%,<?php echo round((($i / posts_per_page()) * 20) + 20); ?>%);">
<article class="wrap">
<h2>
<a href="<?php echo article_url(); ?>" title="<?php echo article_title(); ?>"><?php echo article_title(); ?></a>
</h2>
</article>
</li>
<?php endwhile; ?>
</ul>
<?php if(has_pagination()): ?>
<nav class="pagination">
<div class="wrap">
<?php echo search_prev(); ?>
<?php echo search_next(); ?>
</div>
</nav>
<?php endif; ?>
<?php else: ?>
<p class="wrap">Unfortunately, there's no results for “<?php echo search_term(); ?>”. Did you spell everything correctly?</p>
<?php endif; ?>
<?php theme_include('footer'); ?>