Home › Forums › General Issues › Using checkbox fields in custom queries › Reply To: Using checkbox fields in custom queries
Are you using a checkbox field or a true/false field.
Checkboxes are stored as serialized data and you’re not going to be able to use WP_Query to filter by a checkbox field.
If you use a true/false field then you can use WP_Query, the values of a true/false field are 0 (zero) for false and 1 for true.
the last code example you have should work for a true/false field if use substitute 0 & 1 where you have true and false.
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.