您应该将代码放在循环中并添加到args
大堆\'post_id\' => get_the_ID()
所以应该是这样的:
while(have_posts()){
the_post();
//your post loop output
$args = array(
\'status\' => \'approved\',
\'number\' => \'5\',
\'post_id\' => get_the_ID()
);
$comments = get_comments($args);
foreach($comments as $comment) :
echo( $comment->get_avatar . $comment->comment_author . \'<br />\' . $comment->comment_content);
endforeach;
}