handling empty value + removing unecessary icon query
This commit is contained in:
parent
9afefea23a
commit
de17871391
|
|
@ -6,7 +6,12 @@ $brochuresPosts = $args['brochuresPosts'];
|
||||||
<?php if ($brochuresPosts->have_posts()) : while ($brochuresPosts->have_posts()) : $brochuresPosts->the_post(); ?>
|
<?php if ($brochuresPosts->have_posts()) : while ($brochuresPosts->have_posts()) : $brochuresPosts->the_post(); ?>
|
||||||
<?php
|
<?php
|
||||||
$brochurePdf = get_field('brochure_pdf', get_the_id()) ?? null;
|
$brochurePdf = get_field('brochure_pdf', get_the_id()) ?? null;
|
||||||
$brochureCover = get_field('brochure_cover_image', $brochurePdf['ID']) ?? null;
|
|
||||||
|
|
||||||
|
// RETURN IF NO PDF
|
||||||
|
if (!$brochurePdf) continue;
|
||||||
|
|
||||||
|
$brochureCover = $brochurePdf['ID'] ? get_field('brochure_cover_image', $brochurePdf['ID']) : null;
|
||||||
$brochureEdition = get_field('brochure_edition', get_the_id()) ?? null;
|
$brochureEdition = get_field('brochure_edition', get_the_id()) ?? null;
|
||||||
$thematique = get_the_terms(get_the_id(), 'thematiques')[0] ?? null;
|
$thematique = get_the_terms(get_the_id(), 'thematiques')[0] ?? null;
|
||||||
$rootThematic = getParentThematique($thematique) ?? null;
|
$rootThematic = getParentThematique($thematique) ?? null;
|
||||||
|
|
@ -28,4 +33,8 @@ $brochuresPosts = $args['brochuresPosts'];
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php endwhile ?>
|
<?php endwhile ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if (!$brochuresPosts->have_posts()) : ?>
|
||||||
|
<p class="publications-grid__no-results filters-no-results"><?php echo __("Aucune brochure n'a été trouvée", "homegrade-theme__texte-fonctionnel__publications-archive") ?></p>
|
||||||
|
<?php endif ?>
|
||||||
Loading…
Reference in New Issue
Block a user