updating component to handle post query
This commit is contained in:
parent
7048d8aabe
commit
ef774fddcc
|
|
@ -1,21 +1,28 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$videosWebinairesDatas = $args['videosWebinairesDatas'];
|
$videosWebinairesPosts = $args['videosWebinairesPosts'];
|
||||||
?>
|
?>
|
||||||
<?php foreach ($videosWebinairesDatas as $videoData) : ?>
|
<?php if ($videosWebinairesPosts->have_posts()) : while ($videosWebinairesPosts->have_posts()) : $videosWebinairesPosts->the_post(); ?>
|
||||||
|
<?php
|
||||||
|
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null;
|
||||||
|
$mainThematique = getParentThematique($thematique) ?? null;
|
||||||
|
$mainThematiqueIcon = get_field('taxonomy_pictures', "thematiques_" . $rootThematic->term_id)['icon'] ?? null;
|
||||||
|
$publicationDate = get_field("date", get_the_ID());
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
<li class="publications-grid__row publications-grid--webinaires__row">
|
<li class="publications-grid__row publications-grid--webinaires__row">
|
||||||
|
|
||||||
<img class="publications-grid__video-thumbnail" src="<?php echo $videoData['thumbnail']['url'] ?>" />
|
<img class="publications-grid__video-thumbnail" src="<?php echo the_post_thumbnail_url() ?>" />
|
||||||
|
|
||||||
<h2 class="publications-grid__title"><?php echo $videoData['title'] ?></h2>
|
<h2 class="publications-grid__title"><?php echo get_the_title() ?></h2>
|
||||||
<?php if ($videoData['thematique']) : ?>
|
<?php if ($mainThematique) : ?>
|
||||||
<p class="publications-grid__thematique thematique-tag thematique-tag--<?php echo $videoData['thematique']->slug ?>"><?php echo $videoData['thematique']->name ?></p>
|
<p class="publications-grid__thematique thematique-tag thematique-tag--<?php echo $mainThematique->slug ?>"><?php echo $mainThematique->name ?></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (!$videoData['thematique']) : ?>
|
<?php if (!$mainThematique) : ?>
|
||||||
<p class="publications-grid__thematique thematique-tag thematique-tag--general"><?php echo __("Général", "homegrade-theme_texte-fonctionnel") ?></p>
|
<p class="publications-grid__thematique thematique-tag thematique-tag--general"><?php echo __("Général", "homegrade-theme_texte-fonctionnel") ?></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<p class="publications-grid__edition"><?php echo $videoData['date'] ?></p>
|
<p class="publications-grid__edition"><?php echo $publicationDate ?></p>
|
||||||
|
|
||||||
|
|
||||||
<div class="publications-grid__button">
|
<div class="publications-grid__button">
|
||||||
|
|
@ -23,4 +30,5 @@ $videosWebinairesDatas = $args['videosWebinairesDatas'];
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endwhile ?>
|
||||||
|
<?php endif; ?>
|
||||||
Loading…
Reference in New Issue
Block a user