I'm looking for a way to display a plain-text list of tags to use as classes on my post elements, I've been trying
$tags = get_tags();
$tag_list = "";
foreach($tags as $tag){
$tag_list .= $tag->name . " ";
}
echo "<li class=\"$tag_list\">";
in the loop but it seems to output all the tags instead of just the current post's tags, so if I have tags x
, y
, and z
, and I'm viewing a post with tag x
I still get <li class="x y z">
anybody have any ideas as to how to show a plain-text list of tags or what I'm doing wrong?