Hi everyone,
How can I put the tags from a blog article to the footer in the overall article page?
Thanks in advance and best wishes,
Wolfgang
Hey ZELLERW,
Thank you for the inquiry.
The screenshot above is not displaying correctly. Please post it again using imgur or dropbox. To display the tags in the footer, you may need to modify the footer.php file or the includes > loop-index.php file and use the get_the_tags function.
// https://developer.wordpress.org/reference/functions/get_the_tags/#user-contributed-notes
Best regards,
Ismael
Hi Ismael,
sorry for the incorrect posting of the picture. Here is the imgur link. The example shows the author, date, category and the tags of the article at the bottom of the article on the article overview site or the search result site.
Do you have any idea how to implement that?
Best wishes and thanks in advance
Wolfgang
Hi,
Thank you for the update.
Have you tried using the get_the_tags function as suggested above? If you want to place it below the article, you may need to modify the single.php or the includes > loop-index.php template. This code inside the loop-index.php file outputs the post content.
if ( ! in_array( $blog_style, array( 'bloglist-simple', 'bloglist-compact', 'bloglist-excerpt' ) ) )
{
echo $content_output;
}
To show the tags, you can use this code.
$post_tags = get_the_tags();
if ( ! empty( $post_tags ) ) {
echo '<ul class="av-post-tags">';
foreach( $post_tags as $post_tag ) {
echo '<li><a href="' . get_tag_link( $post_tag ) . '">' . $post_tag->name . '</a></li>';
}
echo '</ul>';
}
Best regards,
Ismael