这是我的疑问:
$list = query_posts(array(
'post_type' => 'post',
'author' => $current_user->ID,
'category__in' => array(11),
));
没关系,但是当我把它改成:
$list = query_posts(array(
'post_type' => 'post',
'author' => $current_user->ID,
'category__in' => array(11),
'meta_key' => 'author_alias_id',
'meta_value' => '1'
));
结果是空的。
有人可以帮助我吗?
答案 0 :(得分:-1)
$args = array(
'post_type' => 'my_custom_post_type',
'meta_key' => 'age',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'age',
'value' => array( 3, 4 ),
'compare' => 'IN',
),
),
);
参考此示例