Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brunomonteiro3/f7b1437e50d439c609d6 to your computer and use it in GitHub Desktop.
Save brunomonteiro3/f7b1437e50d439c609d6 to your computer and use it in GitHub Desktop.
This code will list all the terms from a taxonomy that are associated with a post. Must be inside a loop.
<?
$yourTaxonomySlugHere = get_the_terms($post->ID, 'yourTaxonomySlugHere');
if ($terms) :
foreach ($terms as $term) :
echo $term->name;
endforeach;
endif;
?>
@thiagoeliasr
Copy link

Foda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment