twentythirteen_paging_nav

Display navigation to next/previous set of posts when applicable.

Description

twentythirteen_paging_nav(); 

Usage

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

Defined (1)

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

/functions.php  
  1. function twentythirteen_paging_nav() { 
  2. global $wp_query; 
  3.  
  4. // Don't print empty markup if there's only one page. 
  5. if ( $wp_query->max_num_pages < 2 ) 
  6. return; 
  7. ?> 
  8. <nav class="navigation paging-navigation" role="navigation"> 
  9. <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1> 
  10. <div class="nav-links"> 
  11.  
  12. <?php if ( get_next_posts_link() ) : ?> 
  13. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentythirteen' ) ); ?></div> 
  14. <?php endif; ?> 
  15.  
  16. <?php if ( get_previous_posts_link() ) : ?> 
  17. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentythirteen' ) ); ?></div> 
  18. <?php endif; ?> 
  19.  
  20. </div><!-- .nav-links --> 
  21. </nav><!-- .navigation --> 
  22. <?php