twentytwelve_content_nav

Displays navigation to next/previous pages when applicable.

Description

twentytwelve_content_nav( $html_id ); 

Parameters (1)

0. $html_id
The html id.

Usage

  1. if ( !function_exists( 'twentytwelve_content_nav' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The html id. 
  5. $html_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = twentytwelve_content_nav($html_id); 
  9.  

Defined (1)

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

/functions.php  
  1. function twentytwelve_content_nav( $html_id ) { 
  2. global $wp_query; 
  3.  
  4. $html_id = esc_attr( $html_id ); 
  5.  
  6. if ( $wp_query->max_num_pages > 1 ) : ?> 
  7. <nav id="<?php echo $html_id; ?>" class="navigation" role="navigation"> 
  8. <div class="nav-previous alignleft"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentytwelve' ) ); ?></div> 
  9. <div class="nav-next alignright"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?></div> 
  10. </nav><!-- #<?php echo $html_id; ?> .navigation --> 
  11. <?php endif;