Displays the link to the comments popup window for the current post ID.

Is not meant to be displayed on single posts and pages. Should be used on the lists of posts

Signature

comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false )
zero
 (string) Optional. String to display when no comments. Default false.
Default: false
one
 (string) Optional. String to display when only one comment is available. Default false.
Default: false
more
 (string) Optional. String to display when there are more than one comment. Default false.
Default: false
css_class
 (string) Optional. CSS class to use for comments. Default empty.
Default: ''
none
 (string) Optional. String to display when comments have been turned off. Default false.
Default: false

Return

(null) Returns null on single posts and pages.

Source

function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
	global $wpcommentspopupfile, $wpcommentsjavascript;

	$id = get_the_ID();

	if ( false === $zero ) $zero = __( 'No Comments' );
	if ( false === $one ) $one = __( '1 Comment' );
	if ( false === $more ) $more = __( '% Comments' );
	if ( false === $none ) $none = __( 'Comments Off' );

	$number = get_comments_number( $id );

	if ( 0 == $number && !comments_open() && !pings_open() ) {
		echo '<span' . ((!empty($css_class)) ? ' class="' . esc_attr( $css_class ) . '"' : '') . '>' . $none . '</span>';
		return;
	}

	if ( post_password_required() ) {
		echo __('Enter your password to view comments.');
		return;
37 more lines...
WP Trac GitHub

Link here