get_next_comments_link()
Retrieves the link to the next comments page.
1 time — 0.00019 sec (fast) | 50000 times — 2.7 sec (fast)
Hooks from the function
Return
String|null
. HTML-formatted link for the next page of comments.
Usage
get_next_comments_link( $label, $max_page, $page );
- $label(string)
- Label for link text.
Default: '' - $max_page(int)
- Max page.
- $page(int|null)
- Page number.
Default: null
Examples
#1 Get a link to the current post comments next page
Let's say the post has 44 comments, and we are on page two of the comments, then:
$link = get_next_comments_link(); /* $link will be equal to <a href="http://example.com/foo/comment-page-3#comments">Next comments →</a> */
Notes
- Global. WP_Query. $wp_query WordPress Query object.
Changelog
Since 2.7.1 | Introduced. |
Since 6.7.0 | Added the page parameter. |