comments_number

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

Description

comments_number( (constant) $zero = false, (constant) $one = false, (constant) $more = false, (string) $deprecated = '' ); 

Parameters (4)

0. $zero — Optional. (constant) => false
Text for no comments. Default false.
1. $one — Optional. (constant) => false
Text for one comment. Default false.
2. $more — Optional. (constant) => false
Text for more than one comment. Default false.
3. $deprecated — Optional. (string) => ''
The deprecated.

Usage

  1. if ( !function_exists( 'comments_number' ) ) { 
  2. require_once ABSPATH . WPINC . '/comment-template.php'; 
  3.  
  4. // Optional. Text for no comments. Default false. 
  5. $zero = false; 
  6.  
  7. // Optional. Text for one comment. Default false. 
  8. $one = false; 
  9.  
  10. // Optional. Text for more than one comment. Default false. 
  11. $more = false; 
  12.  
  13. // The deprecated. 
  14. $deprecated = ''; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = comments_number($zero, $one, $more, $deprecated); 
  18.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/comment-template.php  
  1. function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) { 
  2. if ( ! empty( $deprecated ) ) { 
  3. _deprecated_argument( __FUNCTION__, '1.3.0' ); 
  4. echo get_comments_number_text( $zero, $one, $more );