我正在尝试按价格范围获取产品。例如,列出所有价格在0到1000之间的产品(价格会有所不同)。
我的代码是
[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] => NUMERICAL
更改为NUMERIC