R
R
RGoldvarg2016-02-28 15:15:04
WordPress
RGoldvarg, 2016-02-28 15:15:04

How to call a list of tags for a specific post?

Hello.
The task is such that it is necessary to make a conclusion of the tags that were given to a particular post.
<?php wp_tag_cloud(); ?> - works, but calls all the tags that are on the site. And I need to pull out those that were set for each post separately.
Thanks in advance for your help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-02-28
@LazyTalent

<?php
$tags = wp_get_post_tags($post->ID);

if($tags) {
echo "<ul>";
foreach($tags as $tag) {
echo "<li>" . $tag->name . "</li>";
}
echo "</ul>";
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question