get_comments_pagenum_link()
Retrieves the comments page number link.
1 time — 0.00016 sec (fast) | 50000 times — 5.76 sec (fast)
Hooks from the function
Return
String
. The comments page number link URL.
Usage
get_comments_pagenum_link( $pagenum, $max_page );
- $pagenum(int)
- Page number.
Default: 1 - $max_page(int)
- The maximum number of comment pages.
Examples
#1 Get a link to the comment pagination page of the current page
Suppose we are at http://example.com/page
. Then this is how the function will work, with different parameters
echo get_comments_pagenum_link( 5 ); // http://example.com/page/comment-page-5#comments echo get_comments_pagenum_link( 5, 6 ); // http://example.com/page/comment-page-5#comments echo get_comments_pagenum_link( 5, 4 ); // http://example.com/page/comment-page-5#comments echo get_comments_pagenum_link( 5, 5 ); // http://example.com/page#comments
Notes
- Global. WP_Rewrite. $wp_rewrite WordPress rewrite component.
Changelog
Since 2.7.0 | Introduced. |