the_comments_navigation()WP 4.4.0

Displays navigation to next/previous set of comments, when applicable.

1 time — 0.00276 sec (very slow) | 50000 times — 5.96595 sec (fast)

No Hooks.

Return

null. Nothing (null).

Usage

the_comments_navigation( $args );
$args(array)
See get_the_comments_navigation() for available arguments.
Default: empty array

Examples

0

#1 Demo

Suppose the post has 44 comments and we are on the second page of the comment pagination, then:

the_comments_navigation();

Outputs HTML code:

<nav class="navigation comment-navigation" role="navigation">

	<h2 class="screen-reader-text">Comments Navigation</h2>

	<div class="nav-links">
		<div class="nav-previous">
			<a href="http://example.com.ru/foo/comment-page-1#comments">Previous comments</a>
		</div>
		<div class="nav-next">
			<a href="http://example.com.ru/foo/comment-page-3#comments">Next comments</a>
		</div>
	</div>

</nav>

Changelog

Since 4.4.0 Introduced.

the_comments_navigation() code WP 6.7.1

function the_comments_navigation( $args = array() ) {
	echo get_the_comments_navigation( $args );
}