Get taxonomy terms without taxonomy name

I’m trying to display the taxonomy term of a custom post type (like using in regular posts). The code below works but need to specify the taxonomy name, is there a way to use only the Post ID?

<?php

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

Thanks in advance!

Read more here: Get taxonomy terms without taxonomy name

Leave a Reply

Your email address will not be published. Required fields are marked *