1175 posts
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 200 and 499 users
  • Has been a member for 5-6 years
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Greece
  • Has been a member for 2-3 years
  • Sold between 100 and 1 000 dollars
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