Ticket #28405: 28405.patch
| File 28405.patch, 1.5 KB (added by , 12 years ago) |
|---|
-
src/wp-content/themes/twentyfourteen/inc/template-tags.php
14 14 * @since Twenty Fourteen 1.0 15 15 */ 16 16 function twentyfourteen_paging_nav() { 17 global $wp_query, $wp_rewrite; 18 17 19 // Don't print empty markup if there's only one page. 18 if ( $ GLOBALS['wp_query']->max_num_pages < 2 ) {20 if ( $wp_query->max_num_pages < 2 ) { 19 21 return; 20 22 } 21 23 … … 31 33 $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); 32 34 $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; 33 35 34 $format = $ GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';35 $format .= $ GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%';36 $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; 37 $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; 36 38 37 39 // Set up paginated links. 38 40 $links = paginate_links( array( 39 41 'base' => $pagenum_link, 40 42 'format' => $format, 41 'total' => $ GLOBALS['wp_query']->max_num_pages,43 'total' => $wp_query->max_num_pages, 42 44 'current' => $paged, 43 45 'mid_size' => 1, 44 46 'add_args' => array_map( 'urlencode', $query_args ),