feat(article): add display of article keywords
Introduced functionality to display article keywords on single article pages by retrieving metadata and rendering it alongside the abstract. This enriches article content with relevant keyword information, enhancing SEO and user navigation.
This commit is contained in:
parent
a5bcb0342b
commit
81d567447b
1 changed files with 6 additions and 1 deletions
|
@ -27,7 +27,12 @@
|
|||
<?php if (has_excerpt()) : ?>
|
||||
<p class="text-muted"><strong>Abstract:</strong> <?php echo get_the_excerpt(); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$keywords = get_post_meta(get_the_ID(), 'article_keywords', true);
|
||||
if (!empty($keywords)) :
|
||||
echo '<p class="text-muted"><strong>Keywords:</strong> ' . implode(', ', array_map('esc_html', $keywords)) . '</p>';
|
||||
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)) : '';
|
||||
|
|
Loading…
Reference in a new issue