get all taxonomies post_id code example
Example 1: get taxonomy name in singhle post
// RETRIVE TERM SLUG ( for single.php or template-part )
$terms = get_the_terms( $post->ID, 'your-taxonomy' );
if ( !empty( $terms ) ){
// get the first term
$term = array_shift( $terms );
echo $term->slug;
}
Example 2: get term id by post id
INSIDE TAXONOMY PAGES
$term = get_queried_object();
$term_id = $term->term_id;