给出带有自定义字段的帖子
usp-custom-90
其值为字符串
45.46135436613811,9.185124650000043
并且具有GET形式的2个值
$lat = $_GET['usp-custom-20'];
$ln = $_GET['usp-custom-19'];
其中有2个字符串,例如:
45.461
9.177
如何获取45.46135436613811,9.185124650000043
内的所有帖子
我尝试了各种事情,但我感到困惑
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'meta_query' => array(
'relation' => 'AND',
array(
'meta_key' => 'usp-custom-20',
'meta_value' => $ln,
'compare' => '>=',
),
array(
'key' => 'usp-custom-19',
'value' => $lat,
'compare' => '<=',
),
),
);