handling empty value + removing unecessary icon query

This commit is contained in:
Antoine M 2023-12-06 16:24:25 +01:00
parent 66d1242328
commit 2ac170e79c
2 changed files with 5 additions and 3 deletions

View File

@ -2,12 +2,10 @@
// NEEDS TO BE A QUERY POST OBJECT
$brochuresPosts = $args['brochuresPosts'];
?>
<?php if ($brochuresPosts->have_posts()) : while ($brochuresPosts->have_posts()) : $brochuresPosts->the_post(); ?>
<?php
$brochurePdf = get_field('brochure_pdf', get_the_id()) ?? null;
// RETURN IF NO PDF
if (!$brochurePdf) continue;

View File

@ -31,3 +31,7 @@ $fichesInfosPosts = $args['fichesInfosPosts'];
</li>
<?php endwhile ?>
<?php endif; ?>
<?php if (!$fichesInfosPosts->have_posts()) : ?>
<p class="publications-grid__no-results filters-no-results"><?php echo __("Aucune fiche-info n'a été trouvée", "homegrade-theme__texte-fonctionnel__publications-archive") ?></p>
<?php endif ?>