add tax
This commit is contained in:
parent
4e25309391
commit
1fb5efd7dc
@ -7,8 +7,10 @@ $timber_post = new Timber\Post();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'post',
|
||||
'post_status'=>'publish',
|
||||
);
|
||||
|
||||
$context['posts'] = Timber::get_posts( $args );
|
||||
$context['terms'] = Timber::get_terms(array( 'taxonomy'=> 'category', 'hide_empty' => true, 'parent' => 0));
|
||||
|
||||
Timber::render('agenda.twig', $context );
|
||||
|
@ -20,6 +20,7 @@ foreach ( $categories as $category ) {
|
||||
}
|
||||
|
||||
$current_id[] = get_the_ID();
|
||||
|
||||
$args = get_posts(array(
|
||||
'post_type' => 'post',
|
||||
'post_status' => 'publish',
|
||||
|
@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying all single posts
|
||||
*
|
||||
* Methods for TimberHelper can be found in the /lib sub-directory
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Timber
|
||||
* @since Timber 0.1
|
||||
*/
|
||||
|
||||
$context = Timber::context();
|
||||
$timber_post = Timber::query_post();
|
||||
$context['post'] = $timber_post;
|
||||
|
||||
$categories = get_the_terms( $id, 'category' );
|
||||
|
||||
foreach ( $categories as $category ) {
|
||||
$cat = $category->slug;
|
||||
}
|
||||
|
||||
$current_id[] = get_the_ID();
|
||||
$args = get_posts(array(
|
||||
'post_type' => 'post',
|
||||
'post_status' => 'publish',
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'posts_per_page' => -1,
|
||||
'category_name' => $cat,
|
||||
'post__not_in' => $current_id,
|
||||
));
|
||||
|
||||
$context['other'] = $args;
|
||||
|
||||
Timber::render('single.twig', $context );
|
@ -2,10 +2,19 @@
|
||||
|
||||
{% block content %}
|
||||
<section>
|
||||
<ul class="cat-list d-flex flex-wrap">
|
||||
{% for cat in terms %}
|
||||
<a data-filter=".{{cat.slug}}" href="#">
|
||||
<li>{{cat.name}}</li>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<div class="row align-items-start">
|
||||
{% for item in posts %}
|
||||
{% include 'components/thumbnails/thumbnails.twig'%}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
@ -1,7 +1,12 @@
|
||||
{% set cat = item.categories|last %}
|
||||
|
||||
<div class="item thumbnails col-md-4 col-sm-6 {{cat.slug}} {{post.category.slug}}">
|
||||
<a href="{{site.url}}/{{item.post_name}}">
|
||||
|
||||
<div class="item thumbnails col-md-4 col-sm-6">
|
||||
<a href="{{site.url}}/{{item.slug}}">
|
||||
<div class="__images">
|
||||
<div class="icone_cat ">
|
||||
|
||||
</div>
|
||||
<div class="__img">
|
||||
<img src="{{ Image(item.image_event).src|resize(500, 500) }}" >
|
||||
</div>
|
||||
|
@ -1,7 +1,6 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
<div class="content-wrapper">
|
||||
|
||||
<article class="post-type">
|
||||
<img src="{{ Image(post.image_event).src |resize(600, 600) }}" />
|
||||
<section class="article-content">
|
||||
@ -20,6 +19,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="lieu">{{post.lieu}}</div>
|
||||
<div class="cat {{post.category.slug}}">
|
||||
{{post.category.name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="article-body">
|
||||
<p>{{post.description}}</p>
|
||||
|
Loading…
x
Reference in New Issue
Block a user