This might well be the most stupid question on the month, but I’ve been trying for hours and don’t get anywhere, so here goes…
I have a site with two Custom Post Types that each have one Taxonomy with only a single Term attached:
Members –> Departement
Events –> Type of Event
Inside Events, I have a Post Object relational field, where I can select one of the Members as Speaker at an event.
Now what I’m desperately trying to get is this Members Department name, i.e. the Custom Post Type’s Taxonomy or Category. I can get the other fields easily:
$post_object = get_field( 'event_member_speaker' );
if( $post_object ) {
$post = $post_object;
setup_postdata( $post );
$firstName = get_field( 'first_name' );
$lastName = get_field( 'last_name' );
But the Taxonomy term always returns empty, whatever I try.
Before using ACF, I got the term via
$dept = wp_get_object_terms( $id, 'department' );
$dept = $dept[0];
so I’m pretty sure there must be a (probably really simple) way to cajole ACF to show this too, but obviously I’m too thick to see it.