Skip to content

Commit

Permalink
starting the taxonomy things
Browse files Browse the repository at this point in the history
  • Loading branch information
bak11004 committed Mar 4, 2016
1 parent 03e2332 commit 9f2fccd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
5 changes: 5 additions & 0 deletions www/wp-content/themes/ation2016/archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
} else if ( is_post_type_archive() ) {
$context['title'] = post_type_archive_title( '', false );
array_unshift( $templates, 'archive-' . get_post_type() . '.twig' );
} else if ( is_tax('semester') ) {
$term = $wp_query->queried_object;
$context['title'] = $term->name;
$context['debug'] = print_r($term, true);
array_unshift( $templates, 'archive-' . $term->taxonomy . '.twig' );
}

$context['posts'] = Timber::get_posts();
Expand Down
Empty file.
10 changes: 10 additions & 0 deletions www/wp-content/themes/ation2016/templates/archive-semester.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "base.twig" %}

{% block content %}
<div class="container">
<h1>{{title}}</h1>
{% for post in posts %}
{% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
{% endfor %}
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion www/wp-content/themes/ation2016/templates/base.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</header>

<section id="content" role="main" class="content-wrapper">
{% if title %}<h1>{{title}}</h1>{% endif %}
{# {% if title %}<h1>{{title}}</h1>{% endif %} #}
<div class="wrapper {{sidebar_class}}">
{% block content %}
Sorry, no content
Expand Down
13 changes: 8 additions & 5 deletions www/wp-content/themes/ation2016/templates/index.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{% extends "base.twig" %}

{% block content %}
<h2>{{foo}}</h2>
<p>{{qux}}</p>
{% for post in posts %}
{% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
{% endfor %}
<div class="container">
<h2>{{foo}}</h2>
<p>{{qux}}</p>
{% for post in posts %}
{% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
{% endfor %}
<pre>{{debug}}</pre>
</div>
{% endblock %}

0 comments on commit 9f2fccd

Please sign in to comment.