homegrade_theme_production/template-components/archives/webinaire-rows.php

38 lines
1.8 KiB
PHP

<?php
$videosWebinairesPosts = $args['videosWebinairesPosts'];
?>
<?php if ($videosWebinairesPosts->have_posts()) : while ($videosWebinairesPosts->have_posts()) : $videosWebinairesPosts->the_post(); ?>
<?php
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null;
$mainThematique = getMainThematique($thematique) ?? null;
$publicationDate = get_field("video_publication_date", get_the_ID());
$webinaireUrl = get_field("url", get_the_ID());
?>
<li class="publications-grid__row publications-grid--webinaires__row">
<img class="publications-grid__video-thumbnail" src="<?php echo the_post_thumbnail_url() ?>" alt="" />
<h3 class="publications-grid__title"><?php echo get_the_title() ?></h3>
<?php if ($mainThematique) : ?>
<p class="publications-grid__thematique thematique-tag thematique-tag--<?php echo $mainThematique->slug ?>"><?php echo $mainThematique->name ?></p>
<?php endif; ?>
<?php if (!$mainThematique) : ?>
<p class="publications-grid__thematique thematique-tag thematique-tag--general"><?php echo __("Général", "homegrade-theme_texte-fonctionnel") ?></p>
<?php endif; ?>
<p class="publications-grid__edition"><?php echo $publicationDate ?></p>
<div class="publications-grid__button">
<a href="<?php echo $webinaireUrl ?>" class=" cta cta--secondary cta--button" target="_blank"><?php echo __("Voir la vidéo", "homegrade-theme__texte-fonctionnel__publications-archive-brochures") ?></a>
</div>
</li>
<?php endwhile ?>
<?php endif; ?>
<?php if (!$videosWebinairesPosts->have_posts()) : ?>
<p class="publications-grid__no-results filters-no-results"><?php echo __("Aucun webinaire n'a été trouvé", "homegrade-theme__texte-fonctionnel__publications-archive") ?></p>
<?php endif ?>