Skip to content

Instantly share code, notes, and snippets.

@Aziz-Rahman
Created December 10, 2015 08:09
Show Gist options
  • Save Aziz-Rahman/e7e4ea08f72474b5adf4 to your computer and use it in GitHub Desktop.
Save Aziz-Rahman/e7e4ea08f72474b5adf4 to your computer and use it in GitHub Desktop.
Get taxonomy based link in single post
$taxonomy = 'source';
$terms = get_the_terms( $post->ID, $taxonomy );
if ( $terms ) {
foreach($terms as $term) {
$term_link = get_term_link( $term );
}
}
<a href="'. $term_link .'">This is link</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment