I think my previous comment didn’t post! Sorry about that.
Your query is nearly there. Just check out this doc:
You need to make a few modifications to add the LIKE query work. Also, updating to ACF 4.3.0 will ensure that the data is saved in this LIKE friendly format (it is possible that 4.2.2 did not)
Basically, within your loop foreach speaker, you can perform your get_posts query asking for all videos which have selected the current speaker ID and the event ID.
Your code already shows you have figured out this logic.
Something that I can see causing an issue is the setup_postdata function. This is a great function for a single loop, however once you proceed into the nested loop (video), this function will cause all sorts of issues. Basically, it will kill the speakers loop completely!
I would instead, not use the setup_postdata function, but just pass the current ID into all the WP functions. Also, you will need to change your loop to not use the $post variable, instead use $speaker or $event. You can get a title like so:
echo get_the_title( $speaker->ID );
Hope that helps.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.