Skip to content

Commit

Permalink
Add search templates
Browse files Browse the repository at this point in the history
  • Loading branch information
retlehs committed May 7, 2015
1 parent 3b58d76 commit 5313ac7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### HEAD
* Add search templates ([#1459](https://github.com/roots/sage/issues/1459))

### 8.2.1: May 7th, 2015
* Update BrowserSync ([#1457](https://github.com/roots/sage/issues/1457))
* Bump dependencies ([#1448](https://github.com/roots/sage/issues/1448))
Expand Down
14 changes: 14 additions & 0 deletions search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php get_template_part('templates/page', 'header'); ?>

<?php if (!have_posts()) : ?>
<div class="alert alert-warning">
<?php _e('Sorry, no results were found.', 'sage'); ?>
</div>
<?php get_search_form(); ?>
<?php endif; ?>

<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/content', 'search'); ?>
<?php endwhile; ?>

<?php the_posts_navigation(); ?>
9 changes: 9 additions & 0 deletions templates/content-search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<article <?php post_class(); ?>>
<header>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php if (get_post_type() === 'post') { get_template_part('templates/entry-meta'); } ?>
</header>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div>
</article>

0 comments on commit 5313ac7

Please sign in to comment.