get_the_tags and links
-
I’m trying to call a list of tags for each post in a get_post query outside the loop.
I can get it to return all the tags but not the links. I am using this code..
<ul class="tagslist"> <?php global $post; foreach(get_the_tags($post->ID) as $tag) { echo "<li><a href=\"<?php echo get_tag_link($tag_id); ?>\">$tag->name</a></li>"; } ?> </ul>
But all I get is
<a href="<?php echo get_tag_link(0); ?>">Tag</a>
??Does anyone know how I can solve this?
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘get_the_tags and links’ is closed to new replies.