Home › Forums › Front-end Issues › get all posts in custom post type by ACF field value › Reply To: get all posts in custom post type by ACF field value
OK I think it actually needs the ‘array’, like this:
'meta_query' => array(
'key' => 'program_id',
'value' => '5317',
'compare' => 'LIKE'
),
You may or may not need the single-quotes around the value (‘5317’) it depends on how that custom field is setup (the type of field) and you could also try using ‘=’ in place of ‘LIKE’ but LIKE should work too.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.