Ticket #10219: 10219-2.diff
File 10219-2.diff, 5.7 KB (added by , 9 years ago) |
---|
-
src/wp-content/themes/twentyeleven/functions.php
504 504 function twentyeleven_content_nav( $html_id ) { 505 505 global $wp_query; 506 506 507 if ( $wp_query->max_num_pages > 1 ) : ?> 508 <nav id="<?php echo esc_attr( $html_id ); ?>"> 509 <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3> 510 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyeleven' ) ); ?></div> 511 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?></div> 512 </nav><!-- #nav-above --> 513 <?php endif; 507 // Don't print empty markup if there's only one page. 508 if ( $wp_query->max_num_pages < 2 ) { 509 return; 510 } 511 512 $desc_order = 'DESC' === get_query_var( 'order' ); 513 $next_label = __( '<span class="meta-nav">←</span> Older posts', 'twentyeleven' ); 514 $prev_label = __( 'Newer posts <span class="meta-nav">→</span>', 'twentyeleven' ); 515 516 ?> 517 <nav id="<?php echo esc_attr( $html_id ); ?>"> 518 <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3> 519 <div class="nav-<?php echo $desc_order ? 'previous' : 'next'; ?>"><?php next_posts_link( $desc_order ? $next_label : $prev_label ); ?></div> 520 <div class="nav-<?php echo $desc_order ? 'next' : 'previous'; ?>"><?php previous_posts_link( $desc_order ? $prev_label : $next_label ); ?></div> 521 </nav><!-- #nav-above --> 522 <?php 514 523 } 515 524 endif; // twentyeleven_content_nav 516 525 -
src/wp-content/themes/twentythirteen/functions.php
259 259 global $wp_query; 260 260 261 261 // Don't print empty markup if there's only one page. 262 if ( $wp_query->max_num_pages < 2 ) 262 if ( $wp_query->max_num_pages < 2 ) { 263 263 return; 264 } 265 266 $desc_order = 'DESC' === get_query_var( 'order' ); 267 $next_label = __( '<span class="meta-nav">←</span> Older posts', 'twentythirteen' ); 268 $prev_label = __( 'Newer posts <span class="meta-nav">→</span>', 'twentythirteen' ); 269 264 270 ?> 265 271 <nav class="navigation paging-navigation" role="navigation"> 266 272 <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1> 267 273 <div class="nav-links"> 268 274 269 275 <?php if ( get_next_posts_link() ) : ?> 270 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentythirteen' )); ?></div>276 <div class="nav-<?php echo $desc_order ? 'previous' : 'next'; ?>"><?php next_posts_link( $desc_order ? $next_label : $prev_label ); ?></div> 271 277 <?php endif; ?> 272 278 273 279 <?php if ( get_previous_posts_link() ) : ?> 274 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentythirteen' )); ?></div>280 <div class="nav-<?php echo $desc_order ? 'next' : 'previous'; ?>"><?php previous_posts_link( $desc_order ? $prev_label : $next_label ); ?></div> 275 281 <?php endif; ?> 276 282 277 283 </div><!-- .nav-links --> -
src/wp-content/themes/twentytwelve/functions.php
278 278 function twentytwelve_content_nav( $html_id ) { 279 279 global $wp_query; 280 280 281 if ( $wp_query->max_num_pages > 1 ) : ?> 282 <nav id="<?php echo esc_attr( $html_id ); ?>" class="navigation" role="navigation"> 283 <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3> 284 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentytwelve' ) ); ?></div> 285 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?></div> 286 </nav><!-- .navigation --> 287 <?php endif; 281 // Don't print empty markup if there's only one page. 282 if ( $wp_query->max_num_pages < 2 ) { 283 return; 284 } 285 286 $desc_order = 'DESC' === get_query_var( 'order' ); 287 $next_label = __( '<span class="meta-nav">←</span> Older posts', 'twentytwelve' ); 288 $prev_label = __( 'Newer posts <span class="meta-nav">→</span>', 'twentytwelve' ); 289 290 ?> 291 <nav id="<?php echo esc_attr( $html_id ); ?>" class="navigation" role="navigation"> 292 <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3> 293 <div class="nav-<?php echo $desc_order ? 'previous' : 'next'; ?>"><?php next_posts_link( $desc_order ? $next_label : $prev_label ); ?></div> 294 <div class="nav-<?php echo $desc_order ? 'next' : 'previous'; ?>"><?php previous_posts_link( $desc_order ? $prev_label : $next_label ); ?></div> 295 </nav><!-- .navigation --> 296 <?php 288 297 } 289 298 endif; 290 299 -
src/wp-includes/link-template.php
2428 2428 2429 2429 // Don't print empty markup if there's only one page. 2430 2430 if ( $GLOBALS['wp_query']->max_num_pages > 1 ) { 2431 $desc = 'DESC' === get_query_var( 'order' ); 2431 2432 $args = wp_parse_args( $args, array( 2432 'prev_text' => __( 'Older posts' ),2433 'next_text' => __( 'Newer posts' ),2433 'prev_text' => $desc ? __( 'Older posts' ) : __( 'Newer posts' ), 2434 'next_text' => $desc ? __( 'Newer posts' ) : __( 'Older posts' ), 2434 2435 'screen_reader_text' => __( 'Posts navigation' ), 2435 2436 ) ); 2436 2437