get_comments_number


get_comments_number ( $post_id = 0 )

Parameters:
  • (int|WP_Post) $post_id 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

get_comments_number_text, comments_number, get_comment_meta, get_comment_time, get_comments_link

Top Google Results

User discussions

wpseek mobile