0
下面是显示作者至少20个职位并输出职位的代码。WordPress的:列表作者总帖子[包括代码],但需要当前月
我该如何修改它 1)为每月帖子添加一列或者 2)同一行并为当前帖子的帖子添加“,”?
//sort users descending by number of posts
$uc=array();
$blogusers = get_users_of_blog();
if ($blogusers) {
foreach ($blogusers as $bloguser) {
$post_count = get_usernumposts($bloguser->user_id);
$uc[$bloguser->user_id]=$post_count;
}
arsort($uc);
foreach ($uc as $key => $value) {
$user = get_userdata($key);
$author_posts_url = get_author_posts_url($key);
$post_count = $value;
if ($post_count > 20) echo '<br>';
if ($post_count > 21) echo '<a href="' . $author_posts_url .'">' . $user->user_login . '</a> - ' . $post_count . ' posts';
}
}
}
我不是一个编码员,所以这对我来说很难。有没有得到当前月份或类似的时间戳? $ current_month = date('m'); URL:http://codex.wordpress.org/Template_Tags/query_posts#Time_Parameters – user3294699