Php 如何在wordpress中的两个元值范围之间获取post?
我想按价格范围购买产品。例如,列出所有价格在0到1000之间的产品(价格会有所不同) 我的代码是Php 如何在wordpress中的两个元值范围之间获取post?,php,wordpress,Php,Wordpress,我想按价格范围购买产品。例如,列出所有价格在0到1000之间的产品(价格会有所不同) 我的代码是 [post_type] => product [orderby] => ID [post_status] => publish [posts_per_page] => 18 [offset] => 0 [meta_query] => Array ( [relation] => A
[post_type] => product
[orderby] => ID
[post_status] => publish
[posts_per_page] => 18
[offset] => 0
[meta_query] => Array
(
[relation] => AND
[0] => Array
(
[key] => wpcf-price
[value] => Array
(
[0] => 0
[1] => 1000
)
[type] => NUMERICAL
[compare] => BETWEEN
)
)
此代码工作不正常。如何解决此问题?将
[type]=>NUMERIC
更改为NUMERIC