I struggle with a template for a custom post type showing some associated data.
I have set up three custom post types:
- Trainer
- Halle
- Training
Each training has training times. For each training time a trainer and a “halle” is associated.
The trainer for the training can differ depending on the timeslot.
In order to set up the relationship I used ACF repeater fields with the following data:
- Day of the week
- Time
- Trainer (relationship to CPT → Trainer)
- Halle (relationship to CPT → Halle)
For displaying the data on a the training post type this works out.
But I currently struggle how I shoul configer the site of a trainer (template for this post type).
There I want to display all the trainings that are associated with the trainer.
I thought this is possible, but somehow I did not find the way to achieve this.
I set it up like this:
Loop
Type → Post
Post Type → Training
Meta Query:
meta_key: trainer
meta_value {post_title} (should be associated with the trainer of the current page.
What am I doing wrong?