Get Current Post Tags (Without Link to Tag Page)
-
Hello.
I’ve been struggling to get it working for an hour now.
Inside the loop I want to display the post tags associated with a post, but without a link, just a plan, simple, comma-separated list of tags.
This automatically excludes the_tags() which only creates a list with links to tag pages.
Then I’ve tried this:
$posttags = get_the_tags($post->ID); if(!empty($posttags)){ foreach($posttags as $this_tag){ $tagdisplay = $tagdisplay . "".$this_tag->name.", "; } } echo substr($tagdisplay,0,-2); // remove the comma after last tag
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Get Current Post Tags (Without Link to Tag Page)’ is closed to new replies.