Home › Forums › Front-end Issues › ACF checkbox query not working › Reply To: ACF checkbox query not working
Found the cause of this issue by print_r’ing the entire query and inspecting what was actually going on – had done this a number of times, but overlooked the following detail:
The issue here wasn’t actually due to the checkbox meta_query, but a conflict between the get_query_var term (‘courses’) and a custom taxonomy whose slug is also ‘courses’.
When the query was executed, the query seemed to be querying for posts associated with both the custom taxonomy and the selected checkbox value, yielding no results.
Renaming the name attr to something other than courses then reconfiguring the registered query var and meta_query fixed this issue.
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.