Skip to content

Instantly share code, notes, and snippets.

@pdewouters
Created December 7, 2011 17:17
Show Gist options
  • Save pdewouters/1443656 to your computer and use it in GitHub Desktop.
Save pdewouters/1443656 to your computer and use it in GitHub Desktop.
Display taxonomy terms in an unordered list
// courtesy http://wpsnipp.com/index.php/posts/display-taxonomy-terms-in-an-unordered-list/
$terms = get_the_term_list( $post->ID, 'TAXONOMY_NAME',',',',','');
$terms = explode(',',$terms);
echo '<ul>';
for($i = 0;$i<sizeof($terms);$i++){ ?>
<li><? echo $terms[$i]; ?></li>
<? }
echo '</ul>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment