啊,朋友,你不需要这么艰难的方式!这应该可以。。。
<?php
$curauth = get_userdata($row->ID);
$user_link = get_author_posts_url($curauth->ID);
$posts = get_posts(array(
\'author\' => $curauth->ID,
\'cat\' => 60, //for single category, 60
\'cat\' => -60, //for excluding this category
\'posts_per_page\' => -1,
)
);
$post_count = count($posts);
?>
根据您的要求删除注释行。试着让我知道!