fix: remove duplicate author display logic

Removed redundant fallback to `the_author()` when displaying article authors. The authors are already sourced from post meta, ensuring accurate and consistent author data presentation. Streamlined code for better readability and maintainability.
This commit is contained in:
Kumi 2024-09-17 15:51:56 +02:00
parent 9e7dc2c85c
commit a5bcb0342b
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -11,8 +11,6 @@
$authors = get_post_meta(get_the_ID(), 'article_authors', true);
if (!empty($authors)) {
echo implode('; ', array_map('esc_html', $authors));
} else {
the_author();
}
?>
<p class="text-muted">
@ -29,6 +27,7 @@
<?php if (has_excerpt()) : ?>
<p class="text-muted"><strong>Abstract:</strong> <?php echo get_the_excerpt(); ?></p>
<?php endif; ?>
<?php
$attachment_id = get_post_meta(get_the_ID(), 'article_attachment_id', true);
$attachment_url = $attachment_id ? esc_url(home_url('/download/' . $attachment_id)) : '';