Skip to content

Instantly share code, notes, and snippets.

@richardegil
Created November 5, 2012 21:49
Show Gist options
  • Save richardegil/4020564 to your computer and use it in GitHub Desktop.
Save richardegil/4020564 to your computer and use it in GitHub Desktop.
For Carlos
<p><strong>Specialties: </strong>
<?php
global $cpt_onomy;
$terms = get_the_terms( $post->ID, 'specialties' );
echo "<pre>";
print_r($terms);
echo "</pre>";
if ( $terms && ! is_wp_error( $terms ) ) :
$specialties = array();
foreach ( $terms as $term ) {
$specialties[] = '<a href="' . $cpt_onomy->get_term_link( $term, $term->taxonomy ) . '">' . $term->name . '</a>';
}
$specialties_list = join( ", ", $specialties );
echo $specialties_list;
?>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment