Much appreciated! This worked like a charm!
Thank you! I was previously lacking the correct search term so it rendered my search useless.
I ended up using the information from the documentation.
Learning about “Bidirectional Relationships”:
https://www.advancedcustomfields.com/resources/bidirectional-relationships/
Displaying relationships:
https://www.advancedcustomfields.com/resources/querying-relationship-fields/
After a fresh night of sleep, I think I finally got it!
I did notice I had a typo (should be $term->term_id
) in the example above, but I only wrote that as an example so it wasn’t the actual code that I ran.
Regardless, it was really simple once I found out about “Display a value from a specific post“. I didn’t expect it working for terms as well so I disregarded it at first.
<?php
$terms = get_field('multiselect_movies');
if( $terms ): ?>
<?php foreach( $terms as $term ): ?>
<?php
$term_id = $term->term_id;
$movie_id = "movie_" . $term_id;
the_field('movie_website', $movie_id);
?>
<?php endforeach; ?>
<?php endif; ?>
Okay, I feel so stupid for not seeing that the end tags for the loops were out of place…
endif;
endwhile;
Should have been placed before
else :
// no layouts found
That fixed it.