Tell us what you are trying to do?
I have two Custom Post Types:
1. Mitarbeiter (Staff)
2. Klinik (Clinic)
I want a grid with all the "Mitarbeiter"s showing in which "Klinik" they work, like on the single post page here: hidden link
"Klinik für Allgemein-, Viszeral- und Thoraxchirurgie" is the Klinik (Custom Post Type)
Is there any documentation that you are following?
I read up on several forum posts and internet searches.
Is there a similar example that we can see?
On another page I solved it with a Taxonomy called "Abteilung" but that had other drawbacks.
What is the link to your site? hidden link
This is the page with alle "Mitarbeiter"s in a View Loop with a Content Template. Unfortunately, it says "No items found" on that page.
The view 'Kliniken Liste' was set with the 'Kliniken that are related to the current Mitarbeiter' option in the content selection settings, which was working for the case of a single 'Mitarbeiter' post page, but not in a wider context, when used from within another view, that was showing all the 'Mitarbeiter' posts.
I've changed that view's settings to 'All Kliniken' option and added a post-relationship query filter, below it, so that it brings the results related to the 'The current post in the loop'.
( screenshot attached )
After this change, this view is working for both cases.
I hope this helps and please let me know if you need further assistance.
awesome, thanks for your help. Another question: Is it possible to display the related "Kliniken" as a comma-separated list of links? Like this:
View Mitarbeiter of Klinik, Klinik für Anästhesie und Intensivmedizin, Palliativ- und Schmerzmedizin, Klinik für Allgemein-, Viszeral- und Thoraxchirurgie
This guide specifically covers the classic/legacy views, but the same logic should also work with the blocks-based views filters too. It is important to note however, that the 'Views' block doesn't support accepting attributes, so even if you've created a view using the blocks editor, you'll have to call it on a page/post through the views shortcode 'wpv-view', in order to pass some attributes.