Display All Taxonomy Terms In WordPress

May 4th, 2020

I always have to Google this, so putting it here for reference.

If you want to get all of the selected taxonomy terms for a post, use this snippet.

$terms = get_the_terms( $post->ID , 'taxonomy_category' );
foreach ( $terms as $term ) 
{
   echo $term->name;
}

Comments

Leave a Reply