Home › Forums › General Issues › problems using ACF field to display specific posts › Reply To: problems using ACF field to display specific posts
Envirodefence,
It looks like you need to do a meta_query in your get_posts()
function. You can find the docs here: https://www.advancedcustomfields.com/resources/query-posts-custom-fields/. Look under the Custom Fields advanced section for an example on how to query a checkbox. Essentially, you will add a query field like so:
'meta_query' => array(
'key' => 'featured_type',
'value' => 'about',
'compare' => '=',
),
),
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.