Changeset 30216
- Timestamp:
- 11/03/2014 09:39:37 PM (10 years ago)
- Location:
- trunk/src/wp-content/themes/twentyfifteen
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfifteen/archive.php
r30046 r30216 101 101 <?php endwhile; ?> 102 102 103 <?php twentyfifteen_paging_nav(); ?> 103 <?php 104 the_pagination( array( 105 'before_page_number' => '<span class="meta-nav">' . __( 'Page', 'twentyfifteen' ) . '</span>', 106 ) ); 107 ?> 104 108 105 109 <?php else : ?> -
trunk/src/wp-content/themes/twentyfifteen/functions.php
r30116 r30216 261 261 if ( $previous && has_post_thumbnail( $previous->ID ) ) { 262 262 $prevthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $previous->ID ), 'post-thumbnail' ); 263 $css .= '.post-navigation .nav-previous { background-image: url(' . esc_url( $prevthumb[0] ) . '); }'; 263 $css .= ' 264 .post-navigation .nav-previous { background-image: url(' . esc_url( $prevthumb[0] ) . '); } 265 .post-navigation .nav-previous .post-title, .post-navigation .nav-previous .meta-nav { color: #fff; } 266 .post-navigation .nav-previous a:before { background-color: rgba(0, 0, 0, 0.4); } 267 '; 264 268 } 265 269 266 270 if ( $next && has_post_thumbnail( $next->ID ) ) { 267 271 $nextthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $next->ID ), 'post-thumbnail' ); 268 $css .= '.post-navigation .nav-next { background-image: url(' . esc_url( $nextthumb[0] ) . '); }'; 272 $css .= ' 273 .post-navigation .nav-next { background-image: url(' . esc_url( $nextthumb[0] ) . '); } 274 .post-navigation .nav-next .post-title, .post-navigation .nav-next .meta-nav { color: #fff; } 275 .post-navigation .nav-next a:before { background-color: rgba(0, 0, 0, 0.4); } 276 '; 269 277 } 270 278 -
trunk/src/wp-content/themes/twentyfifteen/image.php
r30046 r30216 71 71 ?> 72 72 73 <?php twentyfifteen_post_nav(); ?> 73 <?php 74 the_post_navigation( array( 75 'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentyfifteen' ), 76 ) ); 77 ?> 74 78 75 79 <?php endwhile; // end of the loop. ?> -
trunk/src/wp-content/themes/twentyfifteen/inc/template-tags.php
r30072 r30216 9 9 * @since Twenty Fifteen 1.0 10 10 */ 11 12 if ( ! function_exists( 'twentyfifteen_paging_nav' ) ) :13 /**14 * Display navigation to next/previous set of posts when applicable.15 *16 * @since Twenty Fifteen 1.017 * @uses paginate_links()18 *19 * @global WP_Query $wp_query WordPress Query object.20 */21 function twentyfifteen_paging_nav() {22 // Don't print empty markup if there's only one page.23 if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {24 return;25 }26 27 // Set up paginated links.28 $links = paginate_links( array(29 'prev_text' => esc_html__( 'Previous', 'twentyfifteen' ),30 'next_text' => esc_html__( 'Next', 'twentyfifteen' ),31 'before_page_number' => '<span class="meta-nav">' . esc_html__( 'Page', 'twentyfifteen' ) . '</span>',32 ) );33 34 if ( $links ) :35 ?>36 <nav class="navigation pagination" role="navigation">37 <h2 class="screen-reader-text"><?php esc_html_e( 'Posts navigation', 'twentyfifteen' ); ?></h2>38 <div class="nav-links">39 <?php echo $links; ?>40 </div><!-- .nav-links -->41 </nav><!-- .pagination -->42 <?php43 endif;44 }45 endif;46 47 if ( ! function_exists( 'twentyfifteen_post_nav' ) ) :48 /**49 * Display navigation to next/previous post when applicable.50 *51 * @since Twenty Fifteen 1.052 */53 function twentyfifteen_post_nav() {54 // Don't print empty markup if there's nowhere to navigate.55 $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );56 $next = get_adjacent_post( false, '', false );57 58 if ( ( ! $next && ! $previous ) || ( is_attachment() && 'attachment' == $previous->post_type ) ) {59 return;60 }61 62 $prev_class = $next_class = '';63 64 if ( $previous && has_post_thumbnail( $previous->ID ) ) {65 $prev_class = ' has-post-thumbnail';66 }67 68 if ( $next && has_post_thumbnail( $next->ID ) ) {69 $next_class = ' has-post-thumbnail';70 }71 72 ?>73 <nav class="navigation post-navigation" role="navigation">74 <h2 class="screen-reader-text"><?php esc_html_e( 'Post navigation', 'twentyfifteen' ); ?></h2>75 <div class="nav-links">76 <?php77 if ( is_attachment() ) :78 previous_post_link( '<div class="nav-previous' . $prev_class . '">%link</div>', _x( '<span class="meta-nav">Published In</span><span class="post-title">%title</span>', 'Parent post link', 'twentyfifteen' ) );79 else :80 previous_post_link( '<div class="nav-previous' . $prev_class . '">%link</div>', _x( '<span class="meta-nav">Previous</span><span class="post-title">%title</span>', 'Previous post link', 'twentyfifteen' ) );81 next_post_link( '<div class="nav-next' . $next_class . '">%link</div>', _x( '<span class="meta-nav">Next</span><span class="post-title">%title</span>', 'Next post link', 'twentyfifteen' ) );82 endif;83 ?>84 </div><!-- .nav-links -->85 </nav><!-- .post-navigation -->86 <?php87 }88 endif;89 11 90 12 if ( ! function_exists( 'twentyfifteen_comment_nav' ) ) : -
trunk/src/wp-content/themes/twentyfifteen/index.php
r30072 r30216 41 41 <?php endwhile; ?> 42 42 43 <?php twentyfifteen_paging_nav(); ?> 43 <?php 44 the_pagination( array( 45 'before_page_number' => '<span class="meta-nav">' . __( 'Page', 'twentyfifteen' ) . '</span>', 46 ) ); 47 ?> 44 48 45 49 <?php else : ?> -
trunk/src/wp-content/themes/twentyfifteen/search.php
r30046 r30216 33 33 <?php endwhile; ?> 34 34 35 <?php twentyfifteen_paging_nav(); ?> 35 <?php 36 the_pagination( array( 37 'before_page_number' => '<span class="meta-nav">' . __( 'Page', 'twentyfifteen' ) . '</span>', 38 ) ); 39 ?> 36 40 37 41 <?php else : ?> -
trunk/src/wp-content/themes/twentyfifteen/single.php
r30046 r30216 24 24 ?> 25 25 26 <?php twentyfifteen_post_nav(); ?> 26 <?php 27 the_post_navigation( array( 28 'next_text' => _x( '<span class="meta-nav">Previous</span><span class="post-title">%title</span>', 'Previous post link', 'twentyfifteen' ), 29 'prev_text' => _x( '<span class="meta-nav">Next</span><span class="post-title">%title</span>', 'Next post link', 'twentyfifteen' ), 30 ) ); 31 ?> 27 32 28 33 <?php endwhile; // end of the loop. ?> -
trunk/src/wp-content/themes/twentyfifteen/style.css
r30215 r30216 982 982 } 983 983 984 .post-navigation a:hover .post-title, 985 .post-navigation a:focus .post-title { 986 color: #707070; 987 color: rgba(51, 51, 51, 0.7); 988 } 989 990 .post-navigation .has-post-thumbnail { 984 .post-navigation .nav-next, 985 .post-navigation .nav-previous { 991 986 background-position: center; 992 987 background-size: cover; … … 994 989 } 995 990 996 .post-navigation .has-post-thumbnail a:before { 997 background-color: rgba(0, 0, 0, 0.4); 991 .post-navigation a:before { 998 992 content: ""; 999 993 display: block; … … 1006 1000 } 1007 1001 1008 .post-navigation .has-post-thumbnail a:hover:before, 1009 .post-navigation .has-post-thumbnail a:focus:before { 1010 background-color: rgba(0, 0, 0, 0.2); 1011 } 1012 1013 .post-navigation .has-post-thumbnail a:hover .post-title, 1014 .post-navigation .has-post-thumbnail a:focus .post-title { 1015 color: #fff; 1016 } 1017 1018 .post-navigation .has-post-thumbnail .post-title, 1019 .post-navigation .has-post-thumbnail .meta-nav { 1020 color: #fff; 1021 } 1022 1023 .post-navigation .has-post-thumbnail .meta-nav { 1002 .post-navigation a:hover:before, 1003 .post-navigation a:focus:before { 1004 opacity: 0.5; 1005 } 1006 1007 .post-navigation .meta-nav { 1024 1008 opacity: 0.8; 1025 1009 } 1026 1010 1027 .post-navigation .nav-previous :not(.has-post-thumbnail) + .nav-next:not(.has-post-thumbnail){1011 .post-navigation .nav-previous + .nav-next { 1028 1012 border-top: 1px solid #eaeaea; 1029 1013 border-top: 1px solid rgba(51, 51, 51, 0.1);
Note: See TracChangeset
for help on using the changeset viewer.