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:

Description

Retrieves the amount of comments a post has.

Related Functions

comments_number, get_comments_number_text, get_comment_meta, get_comment_time, get_comments_link

Top Google Results

User discussions

wpseek mobile