1180 posts
  • Affiliate Level 5
  • Author Level 5
  • Collector Level 2
  • Exclusive Author
+2 more
mabuc
says

Hello,

I need some help on how to get a custom tags in single page instead of using the_tags(); function.. here’s my code:

<?php
$taxonomy = 'post_tag';
$terms = get_terms( $taxonomy, '' );
if ($terms) {
foreach($terms as $term) {
if ($term->count > 0) {
?>
<a href="<?php echo esc_attr(get_term_link($term, $taxonomy)) ?>">
<span><?php echo $term->name; ?></span>
</a>
}
}
}
?>

I’m not sure where to insert $post->ID code..

thanks

117 posts
  • 4 Years of Membership
  • Author Level 2
  • Collector Level 1
  • Exclusive Author
+1 more
fAntasticmE
says
for custom taxonomy you should use
<?php get_the_term_list( $id, $taxonomy, $before, $sep, $after ) ?>
for more info look the codex here
by
by
by
by
by
by