I’ve got a custom post type of “Program” and a custom post type of “Venue”.
These are joined by a relationship field on the Program post type called “Location”.
I want to query WordPress to find only the Venues that are attached to a Program. I think I could do it via the posts_where filter but I can’t figure out how to write the MySQL statement to get the venues.
You should just be able to say get_field( 'location' ) when listing out your programs and it should return an array of IDs or Post Objects (depending on the return value you selected for the Relationship field).
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users