get_comments

Definition:
function get_comments( $args = '' ) {}

Retrieve a list of comments.
The comment list can be for the blog as a whole or for an individual post.

Parameters

  • mixed $args: Optional. Array or string of options to override defaults.

Return values

returns:List of comments.

Source code

function get_comments( $args = '' ) {

	$query = new WP_Comment_Query;

	return $query->query( $args );

}

1280

2 Responses to “get_comments”

  1. Where would I put this code on a page to obtain the comments from a certain post?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: