Example 1 — Default link
Print the link to the next page.
<div class="nav-next"><?php next_comments_link(); ?></div> How It Works
- The visitor is on comment page 1.
- WordPress builds a link to page 2.
- The link ends with #comments.

In WordPress, next_comments_link() prints a link to the next page of comments. The default text is Newer Comments ».
It works only when you turn on Break comments into pages in Settings → Discussion. Use it together with previous_comments_link().
Call it with no text for the default label, or set your own label.
next_comments_link();
next_comments_link( 'Newer comments »' ); | Call | What it does |
|---|---|
next_comments_link() | Prints the link with the default text. |
next_comments_link( 'Newer »' ) | Prints the link with your own text. |
next_comments_link( 'Newer »', 5 ) | Sets the last page number yourself. |
Nothing is printed on the last page of comments.
next_comments_link( string $label = '', int $max_page = 0 ): void | Parameter | Description |
|---|---|
$label | Optional. The text of the link. Default Newer Comments ». |
$max_page | Optional. The last page number. Default 0, which means WordPress finds it. |
| Return Value | Description |
|---|---|
| void | Nothing is returned. The function prints one link, or nothing on the last page. |
Three short theme examples. Each one has a sample output.
Print the link to the next page.
<div class="nav-next"><?php next_comments_link(); ?></div> Use your own text.
<?php next_comments_link( 'Show newer comments' ); ?> Show both links in a comment navigation.
<nav class="comment-nav">
<?php previous_comments_link( '« Older' ); ?>
<?php next_comments_link( 'Newer »' ); ?>
</nav> previous_comments_link() goes back one page.next_comments_link() goes forward one page.Print numbered page links for a post with many comments.
9 people found this page helpful