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
Where would I put this code on a page to obtain the comments from a certain post?
You would usually use wp_list_comments() inside the theme as it’s done here for example : https://core.trac.wordpress.org/browser/trunk/wp-content/themes/twentyeleven/comments.php#L54