fix: reparation foreach

This commit is contained in:
Kazhnuz Klappsthul 2021-01-28 19:41:11 +01:00
parent 60d1b31910
commit de0f6d3fd3
1 changed files with 5 additions and 9 deletions

View File

@ -20,13 +20,10 @@
'taxonomy' => 'roman', 'taxonomy' => 'roman',
'hide_empty' => false, 'hide_empty' => false,
) )
); );?>
// Check if any term exists <?php if ( ! empty( $terms ) && is_array( $terms ) ) : ?>
if ( ! empty( $terms ) && is_array( $terms ) ) { <?php foreach ( $terms as $term ) : ?>
// Run a loop and print them all
foreach ( $terms as $term ) { ?>
<article class="card card-preview card-primary"> <article class="card card-preview card-primary">
<a href="<?php echo esc_url( get_term_link( $term ) ) ?>" class="preview-link"> <a href="<?php echo esc_url( get_term_link( $term ) ) ?>" class="preview-link">
<div class="preview-item"> <div class="preview-item">
@ -47,9 +44,8 @@
</div> </div>
</a> </a>
</article> </article>
<?php } <?php endforeach; ?>
} <?php endif; ?>
?>
</div> </div>
</main> </main>