Skip to content

Instantly share code, notes, and snippets.

@sharpmachine
Created June 3, 2014 00:09
Show Gist options
  • Save sharpmachine/e9172baa3773d82289b7 to your computer and use it in GitHub Desktop.
Save sharpmachine/e9172baa3773d82289b7 to your computer and use it in GitHub Desktop.
Get the Current Taxonomy of the Post using get_the_terms in WordPress
?php $terms = get_the_terms( $post->ID , 'Taxonomy Name' );
foreach ( $terms as $term ) {
$term_link = get_term_link( $term, 'Taxonomy Name' );
echo "<a href='".$term_link."'>" . $term->name . "</a>, ";
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment