Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
search round 2
  • Loading branch information
tsm15002 committed Sep 13, 2016
1 parent a528a36 commit cdb9c4c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion search.php
Expand Up @@ -9,7 +9,7 @@
* @since Timber 0.1
*/

$templates = array( 'single.twig' );
$templates = array( 'search.twig' );
$context = Timber::get_context();

$context['title'] = 'Search results for '. get_search_query();
Expand Down
27 changes: 27 additions & 0 deletions templates/search.twig
@@ -0,0 +1,27 @@
{% extends "base.twig" %}

{% block content %}
<div class="subPage subPage--{{ post.get_field('wpcf-parent') }}">
{% if post.get_field('wpcf-hide-back-button') == 0 %}
<nav class="subPageNav u-container">
<a href="/{{ post.get_field('wpcf-parent') }}" class="subPageNav__link">BACK</a>
</nav>
{% endif %}
<div class="u-container">
<main class="subPageMain">
<section class="subPageBody">
{% for result in posts %}
<div class="searchResult">
<h1><a href="{{result.href}}">{{result.title}}</a></h1>
</div>
{% endfor %}
</section>
</main>
</div>
{% if post.get_field('wpcf-hide-back-button') == 0 %}
<nav class="subPageNav u-container">
<a href="/{{ post.get_field('wpcf-parent') }}" class="subPageNav__link">BACK</a>
</nav>
{% endif %}
</div>
{% endblock %}

0 comments on commit cdb9c4c

Please sign in to comment.