0

我使用 wp_query 从某个分类中查询帖子,如下所示:

        $location=urldecode($_GET['location']);
        $property_type=urldecode($_GET['propertyType']);

        query_posts(array(
                    'numberposts'=>-1,
                    'post_type'=>'property',
                    'property-type'=>$property_type,
                    'location'=>$location,
                    'meta_query'=>array(
                        array('key'=>'wpcf-price','value'=>$amount[0],'compare'=>'>=','type' => 'numeric'),
                        array('key'=>'wpcf-price','value'=>$amount[1],'compare'=>'<=','type' => 'numeric')
                    ),
                    'suppress_filters'=>false
        ));

除了这个字符串(它是

תל - אביב יפו

似乎减号以某种方式混淆了搜索,我该如何解决?

有没有办法在这里使用“LIKE”语句?

4

1 回答 1

0

发现了问题,

我使用 $term->name 而不是 $teadm->slug 查询了位置元数据,这解决了这个问题。

于 2012-10-17T16:59:21.623 回答