evolve_custom_number_paging_nav

The evolve evolve custom number paging nav function.

Description

evolve_custom_number_paging_nav(); 

Usage

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

Defined (1)

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

/library/functions/basic-functions.php  
  1. function evolve_custom_number_paging_nav() { 
  2. // Don't print empty markup if there's only one page. 
  3. if ($GLOBALS[wp_query]->max_num_pages < 2) { 
  4. return; 
  5.  
  6. $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1; 
  7. $pagenum_link = html_entity_decode(get_pagenum_link()); 
  8. $query_args = array(); 
  9. $url_parts = explode('?', $pagenum_link); 
  10.  
  11. if (isset($url_parts[1])) { 
  12. wp_parse_str($url_parts[1], $query_args); 
  13.  
  14. $pagenum_link = remove_query_arg(array_keys($query_args), $pagenum_link); 
  15. $pagenum_link = trailingslashit($pagenum_link) . '%_%'; 
  16.  
  17. $format = $GLOBALS[wp_rewrite]->using_index_permalinks() && !strpos($pagenum_link, 'index.php') ? 'index.php/' : ''; 
  18. $format .= $GLOBALS[wp_rewrite]->using_permalinks() ? user_trailingslashit('page/%#%', 'paged') : '?paged=%#%'; 
  19.  
  20. // Set up paginated links. 
  21. $links = paginate_links(array( 
  22. 'base' => $pagenum_link,  
  23. 'format' => $format,  
  24. 'total' => $GLOBALS[wp_query]->max_num_pages,  
  25. 'current' => $paged,  
  26. 'mid_size' => 3,  
  27. 'add_args' => array_map('urlencode', $query_args),  
  28. 'prev_text' => sprintf('<span class="t4p-icon-chevron-left"></span> %s', __('Previous ', 'evolve')),  
  29. 'next_text' => sprintf('%s <span class="t4p-icon-chevron-right"></span>', __('Next ', 'evolve')),  
  30. 'type' => 'list',  
  31. )); 
  32.  
  33. if ($links) : 
  34.  
  35. echo $links; 
  36.  
  37. endif;