未测试,但您可以尝试以下操作:
$args = array(
\'posts_per_page\' => 4,
\'post_type\' => \'post\',
\'meta_key\' => \'meta-select\',
\'order\' => \'ASC\',
\'orderby\' => \'meta_value_num\',
\'meta_query\' => array(
array(
\'key\' => \'meta-select\',
\'value\' => array( 2, 3, 4, 5 ),
\'compare\' => \'IN\',
),
),
);
按元字段的值排序
meta-select
按升序排列。也在
meta_query
, 在可能值数组中检查元值