Hello! I’m having an issue attempting to retrieve some posts using WP_Query. I’ve spent a few hours trawling through the Internet, but not had a lot of luck.
Just a little background:
I’m attempting to retrieve posts that have an ACF field called show_venue, with a value of the title of the current page. show_venue is a post_object field type.
I’ve arrived at the following:
$args = array(
'numberposts' => -1,
'post_type' => 'post',
'meta_key' => 'show_venue',
'meta_key_value' => get_the_title(), // "Venue one"
'order' => 'ASC'
);
Then it’s run by WP_Query.
I’m getting three posts back. Two of them are correctly “Venue one”, but a third post with a value of “Venue two” is appearing. Only these three posts have the field value set.
I’d really appreciate any pointers on where I’m going wrong, I just can’t seem to figure it out.
Thanks for your time! 🙂
– Callum Kerr