A WordPress-centric search engine for devs and theme authors



comments_number ›

Since0.71
Deprecatedn/a
comments_number ( $zero = false, $one = false, $more = false, $post_id = 0 )
Parameters: (4)
  • (string) $zero Optional. Text for no comments. Default false.
    Required: No
    Default: false
  • (string) $one Optional. Text for one comment. Default false.
    Required: No
    Default: false
  • (string) $more Optional. Text for more than one comment. Default false.
    Required: No
    Default: false
  • (int|WP_Post) $post_id Optional. Post ID or WP_Post object. Default is the global `$post`.
    Required: No
    Default:
Defined at:
Codex:
Change Log:
  • 5.4.0

Displays the language string for the number of comments the current post has.



Source

function comments_number( $zero = false, $one = false, $more = false, $post_id = 0 ) {
	echo get_comments_number_text( $zero, $one, $more, $post_id );
}