forked from pipe-code/ditto-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
38 lines (34 loc) · 1.02 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
<?php
/**
* Default search page.
*
* @package ditto_theme
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
get_header();
?>
<main id="dt_search">
<section>
<div class="container">
<div class="row">
<div class="col">
<p>- Default search page -</p>
<p>Search: <?= get_search_query() ?></p>
<p>Results: </p>
<?php if (have_posts()): ?>
<ul>
<?php while ( have_posts() ) : the_post(); ?>
<li><a href="<?= get_the_permalink() ?>"><?= get_the_title() ?></a></li>
<?php endwhile; ?>
</ul>
<?php else: ?>
<p class="sorry">Sorry, but nothing matched your search terms. Please try again with some different keywords.</p>
<?php endif ?>
</div>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>