Answer the question
In order to leave comments, you need to log in
How to display tags inside a post?
Good afternoon!
In WordPress, each post has a list of tags to display inside the_content() itself , in the middle of the text.
Connected PHP execution inside posts and through the_tags() output; , but does not work (something prevents the list of labels from being read) ...
How can I implement it?
Answer the question
In order to leave comments, you need to log in
eval() should not be used. Never.
Such moments are solved through shortcodes.
1. In functions.php
function post_tags_within_content() {
global $post;
$tags = get_the_tag_list( '<p>'Tags: , ', ', '</p>', $post->ID );
return $tags;
}
add_shortcode( 'tags', 'post_tags_within_content' );
...
<p>Tags: tag1, tag2, tag3</p>
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question