您可以获得作者向函数中添加以下代码的最新帖子:
$latest_post = get_posts( array(
\'author\' => $id,
\'orderby\' => \'date\',
\'numberposts\' => 1
));
// Since get_posts() returns an array, but we know we only
// need one element, let\'s just get the element we need.
$latest_post = $latest_post[0];
然后修改
$output
, 添加所需的数据(特别是
guid
对于permalink,以及
post_title
对于标题),例如:
$output .= "<div id=\'bloggers_latest_post\'>
<a href=\'$latest_post->guid\'>$latest_post->post_title</a>
</div>"