Support

Account

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?