I have two CPTs. The first one is “Seminars” and the second one is “Dates”. Both share a Taxonomy which identifies the type of Seminar each Post belongs to. The idea is to have a main page of each Seminar with all the information and a section with the upcoming dates. The Taxonomy should work as a marker to link the Seminars to the Dates, in some way.
Now within the Single Template of the Seminars I tried to add a query loop to show all Dates that are linked to the same Taxonomy value. So e.g. if my Seminar Post has the Taxonomy “Basic Seminar” and I have two Dates that have the “Basic Seminar” Taxonomy, I want to only display those Dates on the Seminar page.
My problem is: Right now nothing is ever returned in that query loop. Even if I query for the standard Wordpress internal “Post” (so not even a CPT) with NO further settings, nothing will show.
Is it not possible to query for another CPT within a Single Post Template?
If that is possible at all, the second question would be:
Is it possible to filter that query loop by Taxonomy of the Post it is queried within?
I have looked for a solution to this for a while now but I just can’t wrap my head around it. Everything I found where somewhat similar requirements and they all either failed, required advanced custom coding knowledge (which I sadly don’t possess) or were directed to paid tutorials (duh). Maybe I am missing something very obvious? Is this kind of thing better done with a Taxonomy query, a Meta query or something else entirely?
Any help is greatly appreciated. Thank you!
Hey Daniel,
I created a small screencast to demonstrate how you could tackle this. Hope I understood your scenario correctly and I hope this helps.
Let me know if anything is unclear.
Best,
André
1 Like
Thank you André for taking the time, that was very helpful!! Much appreciated.
It works now for me too - I think I figured out why it wouldn’t work before: I made the mistake of adding the query loop on a Div - as soon as I added it on a Block element like in your example it worked just fine! 
Not sure if that is expected behaviour but I’m glad I figured it out.
About the Relationship field - I have taken a look at that but I was trying to build it in a way that wouldn’t require ACF Pro. I did however add a Post Object field to connect the Dates to the Seminars the other way around - so that I can output the name and link to the main Seminar on the individual Dates posts. That works fine. Is there any substantial difference to a Relationship field?
I can’t seem to be able to pull any other info than the name and the link in with this method, maybe that is the difference?
I think I am happy with this solution now though. I can query the Dates using the shared Taxonomy and I can query the Seminar on the Dates using the Post Object field.
Thanks again!
Hey Daniel,
glad it helped. 
It should not make a difference if you add the query loop to a block or a div element. So it was probably just a coincidence.
Regarding the differences between the two field types John Huebner’s comment in this thread sums it up pretty well. I personally like to use the post object field for 1:1 relationships and the relationship field for 1:n or n:n relationships.
In regards to the Bricks integration the relationship field is integrated natively to be used in a query loop. Using the post object field you would need to use hooks and some custom code to be able to fetch all the post object’s properties individually at the moment.
Best,
André
1 Like
Ahh I see. The native integration of the Relationship field in Bricks is a big plus indeed.
Thanks again! How do I mark this as solved? 
Hey Daniel,
I’ve marked the thread as SOLVED.
Best,
André
1 Like