Really Really Complicated Query Loop

Hey everyone,

For the Website I am currently building, I need a really complex query loop:

You can look at what I have so far here.
First, there is a parent Loop, which is already built. The parent (inside the nestable tabs element) Loops through the children of a Post of the custom post type “disziplinen”. The Title of the Parent post is “Kartslalom”, and it has 3 children.

Inside the tabs I need another Loop to show events related to that child. To do this, I want to loop through all Posts of the post type “Termin” that have the disziplin subpost of the parent loop assigned via an ACF relation field.

I tried using a Meta Query using the Meta key , a meta value of {post-id} and compare LIKE, but it doesn´t display anything.

Does anyone here know how I could do that?

I think you should query the relation. If ACF you can set up a relation inside a field type, but you can also set up a own field group for that relation. So the field group just holds the relation field but is connected by the bi-directional settings and the posttype setting. (you end up with 2 field groups just for the bi-directional relation)

When you have a field group just for the relation, you can query it separately and get all the relation results.

Another option is to make a template for the separate query and inserting it on the view of the main query.