You may have registered taxonomies for a custom post type. These taxonomies can be displayed in an unordered list in WordPress template pages.
Instructions: Add the following code to a template file of your WordPress theme where you want to display taxonomy terms in unordered list.
<?php $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>'; ?>
You may also enjoy reading about custom taxonomy breadcrumb.
thanks for the code – useful. Is there any way to display not only the terms, but the related images, in a grid?
You can actually accomplish this with far less code. get_the_term_list() allows for before and afters and wraps to be set as parameters, so you could accomplish the same thing using one line of code, e.g.:
you are right, good call Drew, Ill updated the post with the new version.