Searching Custom Fields
Updated this answer in response to first comment below: if(!empty($_GET[‘city’]) AND !empty($_GET[‘state’])) { // if both fields are filled out, find houses that match both $relation = “AND”; } elseif(empty($_GET[‘city’]) OR empty($_GET[‘state’])) { // if either of the fields are empty, find houses that match either field $relation = “OR”; } $args = array( ‘post_type’ … Read more