首先,我使用“author”角色获取用户。
$author_args = array(
\'role\' => \'author\'
);
$authors_list = get_users($author_args);
Nextly I改革阵列$author_list = array();
foreach((array)$authors_list as $author) $author_list[] = $author->user_nicename;
最后查询参数$author_posts_args = array(
\'author_name\' => $author_list,
\'post_type\' => \'post\',
\'cat\' => $colecti_id,
\'posts_per_page\' => \'4\',
);
$author_posts_query = new WP_Query($author_posts_args);
为什么不起作用?