wordpress get posts by taxonomy name code example
Example 1: wordpress get taxonomy of a post
<?php $term_obj_list = get_the_terms( $post->ID, 'taxonomy_name' ); ?>
Example 2: wordpress get post category name
<?php
$categories = get_the_category();
if ( ! empty( $categories ) ) {
echo esc_html( $categories[0]->name ); // Show first item of category
}
?>