Skip to content

Instantly share code, notes, and snippets.

@annelyse
Created June 22, 2021 12:29
Show Gist options
  • Save annelyse/c2713d60bf13f5177d37708791ba2b38 to your computer and use it in GitHub Desktop.
Save annelyse/c2713d60bf13f5177d37708791ba2b38 to your computer and use it in GitHub Desktop.
<?php
// Displays comma separated taxonomy terms.
function entry_terms() {
$terms = get_the_terms( get_the_ID() , 'tags-name' );
if ( ! empty( $terms ) ) {
echo '<p class="entry-meta"><span class="entry-terms">';
foreach ( $terms as $term ) {
$entry_terms .= $term->name . ', ';
}
$entry_terms = rtrim( $entry_terms, ', ' );
echo $entry_terms . '</span></p>';
}
}
entry_terms()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment