Maybe it’s a stupid question but I can’t find the answer.
I have a custom taxonomy (directores) and each director is a term. Some times a film has more than one director. I need to print only the first director no all directors from one film.
Thanks!!!
how about use
get_the_terms()
function?please try this code
Finally I read the WordPress doc Reference/get terms
use this code for access first texonomy from custom post type in wordpress
how about use get_the_terms() function?
please try this code
$works = get_the_terms( $post->ID, ‘work’ );
$director = $works[0];
// print object from first director
print_r($director);
// or get the director name
echo $director->name;