Title: print_embed_comments_button
Published: December 9, 2015
Last modified: February 24, 2026

---

# print_embed_comments_button()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/print_embed_comments_button/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/print_embed_comments_button/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/print_embed_comments_button/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/print_embed_comments_button/?output_format=md#wp--skip-link--target)

Prints the necessary markup for the embed comments button.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/print_embed_comments_button/?output_format=md#source)󠁿

    ```php
    function print_embed_comments_button() {
    	if ( is_404() || ! ( get_comments_number() || comments_open() ) ) {
    		return;
    	}
    	?>
    	<div class="wp-embed-comments">
    		<a href="<?php comments_link(); ?>" target="_top">
    			<span class="dashicons dashicons-admin-comments"></span>
    			<?php
    			printf(
    				/* translators: %s: Number of comments. */
    				_n(
    					'%s <span class="screen-reader-text">Comment</span>',
    					'%s <span class="screen-reader-text">Comments</span>',
    					get_comments_number()
    				),
    				number_format_i18n( get_comments_number() )
    			);
    			?>
    		</a>
    	</div>
    	<?php
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/embed.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/embed.php#L1134)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/embed.php#L1134-L1156)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/print_embed_comments_button/?output_format=md#related)󠁿

| Uses | Description | 
| [_n()](https://developer.wordpress.org/reference/functions/_n/)`wp-includes/l10n.php` |

Translates and retrieves the singular or plural form based on the supplied number.

  | 
| [is_404()](https://developer.wordpress.org/reference/functions/is_404/)`wp-includes/query.php` |

Determines whether the query has resulted in a 404 (returns no results).

  | 
| [comments_open()](https://developer.wordpress.org/reference/functions/comments_open/)`wp-includes/comment-template.php` |

Determines whether the current post is open for comments.

  | 
| [get_comments_number()](https://developer.wordpress.org/reference/functions/get_comments_number/)`wp-includes/comment-template.php` |

Retrieves the amount of comments a post has.

  | 
| [comments_link()](https://developer.wordpress.org/reference/functions/comments_link/)`wp-includes/comment-template.php` |

Displays the link to the current post comments.

  | 
| [number_format_i18n()](https://developer.wordpress.org/reference/functions/number_format_i18n/)`wp-includes/functions.php` |

Converts float number to format based on the locale.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/print_embed_comments_button/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/print_embed_comments_button/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/print_embed_comments_button/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fprint_embed_comments_button%2F)
before being able to contribute a note or feedback.