【问题标题】:Filter wordpress comments by approved按批准过滤 wordpress 评论
【发布时间】:2016-06-28 00:17:43
【问题描述】:
【问题讨论】:
标签:
php
wordpress
comments
wordpress-theming
【解决方案1】:
试试approve 两个P!
get_comments( array('status' => 'approve','order' => 'ASC', 'post_id' => $newpost->ID) );
这里是the docs page for get_comments(您链接到get_comment 单数。)
【解决方案2】:
它对我有用。您可以使用以下代码在段落中显示您批准的 cmets。
<?php foreach (get_comments(array('status' => 'approve','order' => 'ASC', 'post_id' => $newpost->ID)) as $comment): ?>
<div class="comment-show"><h4><?php echo $comment->comment_author; ?> said: </h4> <p>"<?php echo $comment->comment_content; ?>"</p></div>
<?php endforeach; ?>
我在以下网站中使用过展示 cmets
http://rumpa07cse.com/how-to-index-your-website-and-blog-very-quick/