Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在单贴wordpress上显示所有最近的评论_Wordpress_Comments - Fatal编程技术网

在单贴wordpress上显示所有最近的评论

在单贴wordpress上显示所有最近的评论,wordpress,comments,Wordpress,Comments,到目前为止,我已经添加了一个边栏,用于博客以及单个博客文章。我在侧边栏中添加了一个最近的评论部分,它相应地显示在博客页面中,但问题是它不会显示在单个帖子中。下面是显示最新注释的代码。这项工作在博客页面,但显示在单一的职位空。如何在单个页面中显示最近的评论 $comments=get_comments('number=4'); foreach($comments作为$comment){ $comment\u title=获取标题($comment->comment\u post\u ID); $

到目前为止,我已经添加了一个边栏,用于博客以及单个博客文章。我在侧边栏中添加了一个最近的评论部分,它相应地显示在博客页面中,但问题是它不会显示在单个帖子中。下面是显示最新注释的代码。这项工作在博客页面,但显示在单一的职位空。如何在单个页面中显示最近的评论

$comments=get_comments('number=4');
foreach($comments作为$comment){
$comment\u title=获取标题($comment->comment\u post\u ID);
$comment\u link=get\u comment\u link($comment->comment\u ID);
$comment\u temp=get\u comment($comment->comment\u ID,数组A);
$comm_content=$comment_temp['comment_content'];
$post\u id=$comment->comment\u post\u id;
$images\u id=get\u post\u缩略图\u id($post\u id);
$images\u url=wp\u get\u attachment\u image\u src($images\u id,'recentblog',true);
?>

  • 您应该查看该功能,特别是“显示特定页面/帖子的评论”部分…

    不,我不想显示特定帖子的评论。我只想在单个帖子中显示每个帖子最近的所有评论。