twentyeleven_content_nav

Display navigation to next/previous pages when applicable.

Description

twentyeleven_content_nav( (string) $html_id ); 

Parameters (1)

0. $html_id (string)
The HTML id attribute.

Usage

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

Defined (1)

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

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