我正在我的网站上工作,并在wp\\u查询中使用这些参数,但我也想只显示那些有缩略图的帖子。。。以下是我正在处理的参数:
$args1 = array(
\'posts_per_page\' => $number,
\'no_found_rows\' => true,
\'post_status\' => \'publish\',
\'offset\' => $offset,
\'ignore_sticky_posts\' => true,
\'orderby\' => $sort_order,
\'meta_key\' => ( ($sort_order == \'meta_value_num\') ? \'mip_post_views_count\' : \'\' )
);
$args2 = array();
if ($include_categories) {
//$include_categories = explode(",", $include_categories);
$args2 = array(
\'cat\' => $include_categories
);
}
以下是我正在尝试的:
$args1 = array(
\'posts_per_page\' => $number,
\'no_found_rows\' => true,
\'post_status\' => \'publish\',
\'offset\' => $offset,
\'ignore_sticky_posts\' => true,
\'orderby\' => $sort_order,
\'meta_key\' => ( ($sort_order == \'meta_value_num\') ? \'mip_post_views_count\' : \'\' ),
// this is what is added
\'meta_query\' => \'_thumnail_id\'
);
$args2 = array();
if ($include_categories) {
//$include_categories = explode(",", $include_categories);
$args2 = array(
\'cat\' => $include_categories
);
}
但它改变了帖子的顺序。。。有人能提出解决方案吗?