skt_photo_session_pagination

The SKT Photo Session skt photo session pagination function.

Description

skt_photo_session_pagination(); 

Usage

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

Defined (1)

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

/functions.php  
  1. function skt_photo_session_pagination() { 
  2. global $wp_query; 
  3. $big = 12345678; 
  4. $page_format = paginate_links( array( 
  5. 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),  
  6. 'format' => '?paged=%#%',  
  7. 'current' => max( 1, get_query_var('paged') ),  
  8. 'total' => $wp_query->max_num_pages,  
  9. 'type' => 'array' 
  10. ) ); 
  11. if( is_array($page_format) ) { 
  12. $paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged'); 
  13. echo '<div class="pagination"><div><ul>'; 
  14. echo '<li><span>'. $paged . ' of ' . $wp_query->max_num_pages .'</span></li>'; 
  15. foreach ( $page_format as $page ) { 
  16. echo "<li>$page</li>"; 
  17. echo '</ul></div></div>';