此代码是否有帮助
$args = array(
\'cat\' => \'Category id\'
\'post_type\' => \'post type\',
\'meta_key\' => \'enter your metakey\',
\'orderby\' => \'meta_value_num\',
\'order\' => \'ASC\',
\'meta_query\' => array(
array(
\'key\' => \'age\',
\'value\' => array(min price, max price),
\'compare\' => \'IN\',
)
)
);
$query = new WP_Query($args);
$query
将包含
Array
post对象的。
参考号:
https://codex.wordpress.org/Class_Reference/WP_Query