Untitled Snippet
// WP_Comment_Query arguments $args = array ( 'type' => 'comment', 'orderby' => 'user_id', ); // The Comment Query $comment_query = new WP_Comment_Query; $comments = $comment_query->query( $args ); // The Comment Loop if ( $comments ) { foreach ( $comments as $comment ) { // do something } } else { echo 'No comments found.'; }