How can I list all the categories under a Custom Post Type (taxonomy)?

If you just want to list them you can use the get_terms function:

$terms = get_terms( 'my_taxonomy' );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
 echo '<ul>';
 foreach ( $terms as $term ) {
   echo '<li>' . $term->name . '</li>';

 }
 echo '</ul>';
}

Read the codex, it has a lot of examples:
https://codex.wordpress.org/Function_Reference/get_terms

Leave a Comment