Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

nyba comments

A custom comment plugin

// WP_Comment_Query arguments
$args = array (
	'id'             => 'comment_post',
	'parent'         => 'comment_main',
	'status'         => 'approve',
	'karma'          => 'rewards',
	'type'           => 'comment',
	'post_id'        => 'post_rewards',
	'post_parent'    => 'post_main',
	'post_name'      => 'rewards',
	'post_author'    => 'NYBA Staff',
	'post_status'    => 'publish',
	'post_type'      => 'post',
	'author_email'   => '[email protected]',
	'number'         => '5',
	'order'          => 'DESC',
	'orderby'        => 'comment_date_gmt',
	'count'          => true,
);

// 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.';
}