fix other post pSingle
This commit is contained in:
parent
db9bb066cd
commit
919cc086b9
@ -25,4 +25,4 @@ $context = Timber::context();
|
|||||||
|
|
||||||
$timber_post = new Timber\Post();
|
$timber_post = new Timber\Post();
|
||||||
$context['post'] = $timber_post;
|
$context['post'] = $timber_post;
|
||||||
Timber::render( array( 'page.twig' ), $context );
|
Timber::render( 'page.twig', $context );
|
||||||
|
@ -7,4 +7,4 @@ $context = Timber::context();
|
|||||||
|
|
||||||
$timber_post = new Timber\Post();
|
$timber_post = new Timber\Post();
|
||||||
$context['post'] = $timber_post;
|
$context['post'] = $timber_post;
|
||||||
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'privatiser_lespace.twig' ), $context );
|
Timber::render( 'privatiser_lespace.twig', $context );
|
||||||
|
@ -13,6 +13,23 @@ $context = Timber::context();
|
|||||||
$timber_post = Timber::query_post();
|
$timber_post = Timber::query_post();
|
||||||
$context['post'] = $timber_post;
|
$context['post'] = $timber_post;
|
||||||
|
|
||||||
$context['posts'] = get_posts();
|
$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 );
|
Timber::render('single.twig', $context );
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<span class="end">
|
<span class="end">
|
||||||
<time><p>au</p>{{post.fin_event}}</time>
|
<time><p>au</p>{{post.fin_event}}</time>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="lieu">{{post.lieu}}</div>
|
<div class="lieu">{{post.lieu}}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -66,15 +66,9 @@
|
|||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="other-posts">
|
<div class="other-posts">
|
||||||
{% for item in posts %}
|
{% for item in other %}
|
||||||
{% include 'components/thumbnails/thumbnails.twig' %}
|
{% include 'components/thumbnails/thumbnails.twig' %}
|
||||||
{#{% if {{site.url}} == "{{item.slug}}" %}
|
{% endfor %}
|
||||||
{% else %}
|
</div>
|
||||||
{% include 'components/thumbnails/thumbnails.twig' %}
|
|
||||||
{% endif %}#}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user