Home › Forums › Front-end Issues › Exclude custom posts from pre_get_posts based on custom field › Reply To: Exclude custom posts from pre_get_posts based on custom field
I came a bit on the way to finding a solution.
I change the compare to:
‘compare’ => ‘NOT EXISTS’
and the query now returns the right posts but it ignores the =true =false values
The urls:
http://www.website.com/events?city=true
http://www.website.com/events?city=false
just returns the same?
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.