Get the term id belonging to custom taxonomy on a custom single-post-type.php template page

you can use the get_the_terms() function to get the terms of that post in a specific taxonomy:

$terms = get_the_terms( $post->ID , 'speaker' ); //change speaker to whatever you call your taxonomy
//then you can use just the first term
$term_id = $terms[0]->term_id;

and now you have the term id inside $term_id.

update

Once you have the term_id you can use it in your function like so:

$term_id = $termid->term_id;

$meta = isset($meta[$term_id]) ? $meta[$term_id] : array();

Leave a Comment