# How to use meta query

**URL:** <https://forum.bricksbuilder.io/t/how-to-use-meta-query/28947>\
**Category:** Uncategorized\
**Tags:** how-to\
**Created:** [December 23, 2024, 6:57pm UTC](https://forum.bricksbuilder.io/t/how-to-use-meta-query/28947 "2024-12-23T18:57:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trise](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/t/9dc877/32.png) [@trise](https://forum.bricksbuilder.io/u/trise)\
**Post date:** [December 23, 2024, 6:57pm UTC](https://forum.bricksbuilder.io/t/how-to-use-meta-query/28947/1 "2024-12-23T18:57:14Z")

</div>

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?
