FEATURE Introducing variant with show authors
This commit is contained in:
parent
7b8164c088
commit
15487c8891
|
|
@ -8,7 +8,8 @@ $link = get_the_permalink($ID);
|
||||||
$related_revue = get_field('related_revue', $ID);
|
$related_revue = get_field('related_revue', $ID);
|
||||||
$related_revue_issue_number = $related_revue ? get_field('issue_number', $related_revue) : null;
|
$related_revue_issue_number = $related_revue ? get_field('issue_number', $related_revue) : null;
|
||||||
|
|
||||||
|
$showAuthors = $args['showAuthors'] ?? false;
|
||||||
|
$authors = get_field('authors', $ID);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
@ -25,6 +26,22 @@ $related_revue_issue_number = $related_revue ? get_field('issue_number', $relate
|
||||||
</div>
|
</div>
|
||||||
<h3 class="post-card__title"><?php echo $title; ?></h3>
|
<h3 class="post-card__title"><?php echo $title; ?></h3>
|
||||||
<time class="post-card__date" datetime="<?php echo $date; ?>"><?php echo $date; ?></time>
|
<time class="post-card__date" datetime="<?php echo $date; ?>"><?php echo $date; ?></time>
|
||||||
|
|
||||||
|
<?php if ($showAuthors && $authors) : ?>
|
||||||
|
<ul class="post-card__authors">
|
||||||
|
<?php foreach ($authors as $author) : ?>
|
||||||
|
<?php
|
||||||
|
$name = get_the_title($author);
|
||||||
|
if (!$name || empty($name)) continue;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<li class="post-card__author-name">
|
||||||
|
<?php echo $name ?>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="issue-number">
|
<div class="issue-number">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user