Hello, I have two CPT made with ACF.
Post Type 1 = artist
Post Type 2 = event
When I am on a post from an artist I want to list all events related to him.
I found the code below in this forum but it didn’t work. I have a temporary wordpress page set if it helps. The Bidrectional fields allow selecting multiple artists.
return [
'post_type' => 'event', //e.g. post type key
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'acf_artist, // the ACF rel field
'value' => get_the_id(),
'compare' => 'LIKE'
)
),
'order' => 'ASC',
'orderby'=> 'title',
];
I must have deleted the apostrophe after copying it here, but it is in the code. I tried both artist and acf_artist (because when I use it in the dynamic field the value generated is {acf_artist} and still no result