Merge pull request #1459 from roots/search-templates
Add search templates
This commit is contained in:
@@ -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))
|
||||
|
||||
14
search.php
Normal file
14
search.php
Normal file
@@ -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
templates/content-search.php
Normal file
9
templates/content-search.php
Normal file
@@ -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>
|
||||
Reference in New Issue
Block a user