next_comments_link()
Outputs a link (A tag) to the next page of comments.
Uses: get_next_comments_link()
1 time — 0.00019 sec (fast) | 50000 times — 2.7 sec (fast)
No Hooks.
Returns
null. Outputs the HTML code for the link.
Usage
<?php next_comments_link( $label, $max_page ) ?>
- $label(string)
- Text of the link.
Default: '' ("Next comments →") - $max_page(int)
- Maximum depth of pages for which the link will be displayed.
Default: 0
Examples
#1 Display a link to the next page of comments
Let's say the post has 44 comments and we are on the second page of comments, then:
<?php next_comments_link() ?>
This code will output the following HTML:
<a href="http://example.com/foo/comment-page-3#comments">Following comments →</a>
Changelog
| Since 2.7.0 | Introduced. |
next_comments_link() next comments link code WP 6.9.1
function next_comments_link( $label = '', $max_page = 0 ) {
echo get_next_comments_link( $label, $max_page );
}