Support

Account

Home Forums Front-end Issues Query multiple meta_keys with the same value Reply To: Query multiple meta_keys with the same value

  • It didn’t work, at first.
    Then, I changed the $meta_query to $args (at the top). And it works! Thank you.

    $args = array(
      'relation' => 'OR',
      array(
        'key' => 'service1',
        'value' => $_GET['service']
      ),
      array(
        'key' => 'service2',
        'value' => $_GET['service']
      ),
      array(
        'key' => 'service3',
        'value' => $_GET['service']
      ),
      array(
        'key' => 'service4',
        'value' => $_GET['service']
      ),
    )
    $query->set('meta_query', $args);