FIX Conditionnal display of tags to avoid empty vertical space when no tags

This commit is contained in:
Nonimart 2025-06-25 11:44:45 +02:00
parent f37f9cca3a
commit 435eb4f218

View File

@ -4,9 +4,11 @@ $articleContent = get_the_content($articleID);
$articleTitle = get_the_title($articleID); $articleTitle = get_the_title($articleID);
$citeReference = get_field('cite_reference', $articleID); $citeReference = get_field('cite_reference', $articleID);
$tags = get_the_terms($articleID, 'etiquettes'); $tags = get_the_terms($articleID, 'etiquettes');
?> ?>
<article class="article-content"> <article class="article-content">
<?php if ($tags) : ?>
<ul class="article-tags-list"> <ul class="article-tags-list">
<?php foreach ($tags as $tag) : ?> <?php foreach ($tags as $tag) : ?>
<li class="article-tag"> <li class="article-tag">
@ -14,7 +16,10 @@ $tags = get_the_terms($articleID, 'etiquettes');
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?>
<?php the_content(); ?> <?php the_content(); ?>
<?php if ($citeReference) : ?> <?php if ($citeReference) : ?>
<p id="cite-reference"> <p id="cite-reference">
<?php echo $citeReference; ?> <?php echo $citeReference; ?>