Initial commit
This commit is contained in:
21
single.php
Normal file
21
single.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
$context = Timber::context();
|
||||
$post = Timber::get_post();
|
||||
$context['post'] = $post;
|
||||
$context['article'] = thalim_get_single_data($post->ID);
|
||||
|
||||
// Card data for related posts (main + séances)
|
||||
$related_cards = [];
|
||||
if (!empty($context['article']['annonces_liees'])) {
|
||||
$related_cards += thalim_get_cards_data($context['article']['annonces_liees']);
|
||||
}
|
||||
foreach (['seances_a_venir', 'seances_passees'] as $seance_group) {
|
||||
foreach ($context['article'][$seance_group] as $s) {
|
||||
if (!empty($s['annonces_liees'])) {
|
||||
$related_cards += thalim_get_cards_data($s['annonces_liees']);
|
||||
}
|
||||
}
|
||||
}
|
||||
$context['related_cards'] = $related_cards;
|
||||
|
||||
Timber::render('single.twig', $context);
|
||||
Reference in New Issue
Block a user