-
-
Save Kuprich/df0d88d68578c618ce3acc0c5b7ab240 to your computer and use it in GitHub Desktop.
WordPress Вывод всех меток из записи
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class=" | |
$tags = wp_get_post_tags($post->ID); | |
if ($tags){ | |
foreach ($tags as $tag){ | |
echo ' '.$tag->name; | |
} | |
} | |
"> | |
/* | |
* $tags = wp_get_post_tags($post->ID); $tags это список меток указанного поста в виде массива. | |
* массив имеет много параметров, выводим в строку только параметр Name | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment