Display the language string for the number of comments the current post has.
Signature
comments_number( $zero = false, $one = false, $more = false, $deprecated = '' )
- zero
- (string) Text for no comments
Default:false - one
- (string) Text for one comment
Default:false - more
- (string) Text for more than one comment
Default:false - deprecated
- (string) Not used.
Default:''
Return
(void)
Source
function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '1.3' );
$number = get_comments_number();
if ( $number > 1 )
$output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);
elseif ( $number == 0 )
$output = ( false === $zero ) ? __('No Comments') : $zero;
else // must be one
$output = ( false === $one ) ? __('1 Comment') : $one;
echo apply_filters('comments_number', $output, $number);
}
WP Trac GitHub Bitbucket
Link here
-
URL
http://queryposts.com/function/comments_number/ -
HTML
<a href='http://queryposts.com/function/comments_number/'>comments_number()</a> -
Markdown
[comments_number()](http://queryposts.com/function/comments_number/) -
BBCode
[url=http://queryposts.com/function/comments_number/]comments_number()[/url]