Wordpress WP_Query where clause with OR?

前端 未结 4 507
梦谈多话
梦谈多话 2020-12-21 09:02

hello friends this is my args for WP_Query.

$args = array(\'post_type\' => \'job_listing\');
$args[\'meta_query\']=array(
   \'relation\' => \'OR\',
           


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-21 10:02

    changed args with like.

    $args = array('post_type' => 'job_listing', 'relation' => 'OR');
    $args['meta_query']=array(
        array(
            'key' => 'app_trailer-type',
            'value' => $job_tailor,
            'compare' => 'LIKE'
        ),
        array(
            'key' => 'app_pay-type',
            'value' => $app_pay_type,
            'compare' => 'LIKE'
        ),
        array(
            'key' => 'geo_address',
            'value' => $geo_address,
            'compare' => 'LIKE'
        ),
        array(
            'key' => 'geo_country',
            'value' => $geo_country,
            'compare' => 'LIKE'
        ),
        array(
            'key' => 'geo_short_address',
            'value' => $geo_short_address,
            'compare' => 'LIKE'
        ),
    );
    

提交回复
热议问题