twentyfifteen_comment_nav

Display navigation to next/previous comments when applicable.

Description

twentyfifteen_comment_nav(); 

Usage

  1. if ( !function_exists( 'twentyfifteen_comment_nav' ) ) { 
  2. require_once '/inc/template-tags.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = twentyfifteen_comment_nav(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/template-tags.php  
  1. function twentyfifteen_comment_nav() { 
  2. // Are there comments to navigate through? 
  3. if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : 
  4. ?> 
  5. <nav class="navigation comment-navigation" role="navigation"> 
  6. <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfifteen' ); ?></h2> 
  7. <div class="nav-links"> 
  8. <?php 
  9. if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) : 
  10. printf( '<div class="nav-previous">%s</div>', $prev_link ); 
  11. endif; 
  12.  
  13. if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) : 
  14. printf( '<div class="nav-next">%s</div>', $next_link ); 
  15. endif; 
  16. ?> 
  17. </div><!-- .nav-links --> 
  18. </nav><!-- .comment-navigation --> 
  19. <?php 
  20. endif;