22 lines
705 B
PHP
22 lines
705 B
PHP
<?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);
|