Created
June 3, 2014 00:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?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