History of Rigor Chapter 3-3
//Get only the approved comments
$args = array(
'status' => 'approve'
);
// The comment Query
$comments_query = new WP_Comment_Query;
$comments = $comments_query->query( $args );
// Comment Loop
if ( $comments ) {
foreach ( $comments as $comment ) {
echo '
' . $comment->comment_content . '
'; } } else { echo 'No comments found.'; }