get_comments_number
get_comments_number ( $post = 0 )
Parameters:- (int|WP_Post) post Optional. Post ID or WP_Post object. Default is the global `$post`.
Returns:- (string|int) If the post exists, a numeric string representing the number of comments the post has, otherwise 0.
Defined at: - Introduced in WordPress: 1.5.0
- Deprecated in WordPress: —
Description
Retrieves the amount of comments a post has.