Ticket #25718: 25718.diff
File 25718.diff, 11.9 KB (added by , 11 years ago) |
---|
-
wp-content/themes/twentyfourteen/content-featured-post.php
12 12 <a class="attachment-featured-featured" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>"> 13 13 <?php 14 14 if ( has_post_thumbnail() ) : 15 the_post_thumbnail( ' featured-thumbnail-featured' );15 the_post_thumbnail( 'post-thumbnail-grid' ); 16 16 17 17 else : 18 18 $images = get_children( array( … … 26 26 27 27 if ( $images ) : 28 28 $image = array_shift( $images ); 29 echo wp_get_attachment_image( $image->ID, ' featured-thumbnail-featured' );29 echo wp_get_attachment_image( $image->ID, 'post-thumbnail-grid' ); 30 30 endif; 31 31 endif; 32 32 ?> -
wp-content/themes/twentyfourteen/content-gallery.php
26 26 27 27 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 28 28 <?php if ( is_single() && $image ) : ?> 29 <div class=" featured-thumbnail">30 <?php echo wp_get_attachment_image( $image, ' featured-thumbnail-large' ); ?>29 <div class="post-thumbnail"> 30 <?php echo wp_get_attachment_image( $image, 'post-thumbnail' ); ?> 31 31 </div> 32 32 <?php elseif ( $image ) : ?> 33 <a class=" featured-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">34 <?php echo wp_get_attachment_image( $image, ' featured-thumbnail-large' ); ?>33 <a class="post-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>"> 34 <?php echo wp_get_attachment_image( $image, 'post-thumbnail' ); ?> 35 35 </a> 36 36 <?php endif; ?> 37 37 -
wp-content/themes/twentyfourteen/functions.php
68 68 add_theme_support( 'post-thumbnails' ); 69 69 70 70 // Add several sizes for Post Thumbnails. 71 add_image_size( 'featured-thumbnail-large', 672, 0 ); 72 add_image_size( 'featured-thumbnail-featured', 672, 372, true ); 73 add_image_size( 'featured-thumbnail-formatted', 306, 0 ); 71 add_image_size( 'post-thumbnail-grid', 672, 372, true ); 72 add_image_size( 'post-thumbnail', 672, 0 ); 74 73 75 74 // This theme uses wp_nav_menu() in two locations. 76 75 register_nav_menus( array( … … 361 360 * 362 361 * Adds body classes to denote: 363 362 * 1. Single or multiple authors. 364 * 2. Index views. 365 * 3. Full-width content layout. 366 * 4. Presence of footer widgets. 363 * 2. Presense of header image. 364 * 3. Index views. 365 * 4. Full-width content layout. 366 * 5. Presence of footer widgets. 367 * 6. Single views. 367 368 * 368 369 * @since Twenty Fourteen 1.0 369 370 * … … 391 392 if ( is_active_sidebar( 'sidebar-3' ) ) 392 393 $classes[] = 'footer-widgets'; 393 394 395 if ( is_singular() ) 396 $classes[] = 'singular'; 397 394 398 return $classes; 395 399 } 396 400 add_filter( 'body_class', 'twentyfourteen_body_classes' ); … … 399 403 * Extend the default WordPress post classes. 400 404 * 401 405 * Adds a post class to denote: 402 * Non-password protected page with a featured image.406 * Non-password protected page with a post thumbnail. 403 407 * 404 408 * @since Twenty Fourteen 1.0 405 409 * … … 408 412 */ 409 413 function twentyfourteen_post_classes( $classes ) { 410 414 if ( ! post_password_required() && has_post_thumbnail() ) 411 $classes[] = 'has-featured-image'; 415 $classes[] = 'has-post-thumbnail'; 416 else 417 $classes[] = 'no-post-thumbnail'; 412 418 413 419 return $classes; 414 420 } -
wp-content/themes/twentyfourteen/inc/template-tags.php
159 159 add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); 160 160 161 161 /** 162 * Displays an optional featured image, with an anchor element162 * Displays an optional post thumbnail, with an anchor element 163 163 * when on index views, and a div element when on a single view. 164 164 * 165 165 * @return void … … 171 171 if ( is_singular() ) : 172 172 ?> 173 173 174 <div class=" featured-thumbnail">175 <?php the_post_thumbnail( ' featured-thumbnail-large' ); ?>174 <div class="post-thumbnail"> 175 <?php the_post_thumbnail( 'post-thumbnail' ); ?> 176 176 </div> 177 177 178 178 <?php else : ?> 179 179 180 <a class=" featured-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">180 <a class="post-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>"> 181 181 <?php if ( has_post_thumbnail() ) : 182 the_post_thumbnail( ' featured-thumbnail-large' );182 the_post_thumbnail( 'post-thumbnail' ); 183 183 else : ?> 184 184 <p class="screen-reader-text"><?php _e( 'No featured image.', 'twentyfourteen' ); ?></p> 185 185 <?php endif; ?> -
wp-content/themes/twentyfourteen/inc/widgets.php
137 137 $total_images = count( $images ); 138 138 139 139 if ( has_post_thumbnail() ) : 140 $ featured_image = get_the_post_thumbnail( get_the_ID(), 'featured-thumbnail-formatted' );140 $post_thumbnail = get_the_post_thumbnail( get_the_ID(), 'post-thumbnail' ); 141 141 elseif ( $total_images > 0 ) : 142 142 $image = array_shift( $images ); 143 $ featured_image = wp_get_attachment_image( $image, 'featured-thumbnail-formatted' );143 $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' ); 144 144 endif; 145 145 ?> 146 <a href="<?php the_permalink(); ?>"><?php echo $ featured_image; ?></a>146 <a href="<?php the_permalink(); ?>"><?php echo $post_thumbnail; ?></a> 147 147 <p class="wp-caption-text"> 148 148 <?php 149 149 printf( _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ), -
wp-content/themes/twentyfourteen/rtl.css
361 361 362 362 /* Mobile list style */ 363 363 @media screen and (max-width: 400px) { 364 .list-view . featured-thumbnail img {364 .list-view .post-thumbnail img { 365 365 float: right; 366 366 margin: 0 0 3px 10px; 367 367 } -
wp-content/themes/twentyfourteen/style.css
35 35 * 6.9 - Contributor Page 36 36 * 6.10 - 404 Page 37 37 * 6.11 - Front Page 38 * 6.12 - Comments 38 * 6.12 - Full-width 39 * 6.13 - Comments 39 40 * 7.0 - Sidebar 40 41 * 7.1 - Widgets 41 42 * 7.2 - Content Sidebar Widgets … … 561 562 } 562 563 563 564 .attachment-featured-featured img, 564 . featured-thumbnail img {565 .post-thumbnail img { 565 566 height: auto; 566 567 max-width: 100%; 567 568 } … … 984 985 max-width: 672px; 985 986 } 986 987 987 .full-width .hentry {988 max-width: 100%;989 }990 991 988 .site-content .entry-header, 992 989 .site-content .entry-content, 993 990 .site-content .entry-summary, … … 1003 1000 * ----------------------------------------------------------------------------- 1004 1001 */ 1005 1002 1006 . featured-thumbnail {1003 .post-thumbnail { 1007 1004 background: url(images/pattern-light.svg) #767676 repeat fixed; 1008 1005 display: none; 1009 1006 float: none; … … 1015 1012 z-index: 0; 1016 1013 } 1017 1014 1018 a. featured-thumbnail:hover {1015 a.post-thumbnail:hover { 1019 1016 background: url(images/pattern-light.svg) #919191 repeat fixed; 1020 1017 } 1021 1018 1022 . featured-thumbnail img {1019 .post-thumbnail img { 1023 1020 display: block; 1024 1021 margin: 0 auto; 1025 1022 } 1026 1023 1027 .has- featured-image .featured-thumbnail,1028 .format-standard . featured-thumbnail {1024 .has-post-thumbnail .post-thumbnail, 1025 .format-standard .post-thumbnail { 1029 1026 display: block; 1030 1027 } 1031 1028 … … 1045 1042 padding: 0 10px 12px; 1046 1043 } 1047 1044 1048 .site-content .has- featured-image.entry-header,1045 .site-content .has-post-thumbnail .entry-header, 1049 1046 .site-content .format-standard .entry-header { 1050 1047 padding-top: 24px; 1051 1048 } … … 1743 1740 1744 1741 1745 1742 /** 1746 * 6.1 1 Comments1743 * 6.12 Full-width 1747 1744 * ----------------------------------------------------------------------------- 1748 1745 */ 1749 1746 1747 .full-width.singular .content-area { 1748 padding-top: 0; 1749 } 1750 1751 .full-width .hentry { 1752 max-width: 100%; 1753 } 1754 1755 .full-width.singular .hentry.no-post-thumbnail, 1756 .full-width.singular .hentry.no-post-thumbnail.format-standard.post-password-required { 1757 padding-top: 24px; 1758 } 1759 1760 .full-width.singular .hentry.no-post-thumbnail.format-standard { 1761 padding-top: 0; 1762 } 1763 1764 1765 /** 1766 * 6.13 Comments 1767 * ----------------------------------------------------------------------------- 1768 */ 1769 1750 1770 .comments-area { 1751 1771 margin: 48px auto; 1752 1772 max-width: 474px; … … 2530 2550 */ 2531 2551 2532 2552 @media screen and (max-width: 400px) { 2533 .list-view . featured-thumbnail {2553 .list-view .post-thumbnail { 2534 2554 background: none; 2535 2555 min-height: 0; 2536 2556 width: auto; 2537 2557 z-index: 2; 2538 2558 } 2539 2559 2540 .list-view . featured-thumbnail img {2560 .list-view .post-thumbnail img { 2541 2561 float: left; 2542 2562 margin: 0 10px 3px 0; 2543 2563 width: 84px; … … 2600 2620 } 2601 2621 2602 2622 @media screen and (min-width: 401px) { 2603 a. featured-thumbnail:hover img {2623 a.post-thumbnail:hover img { 2604 2624 opacity: 0.85; 2605 2625 } 2606 2626 … … 2702 2722 margin: -3px 2px 0 0; 2703 2723 } 2704 2724 2705 .list-view .site-content .has- featured-image .featured-thumbnail,2706 .list-view .site-content .format-standard . featured-thumbnail {2725 .list-view .site-content .has-post-thumbnail .post-thumbnail, 2726 .list-view .site-content .format-standard .post-thumbnail { 2707 2727 margin-top: -49px; 2708 2728 } 2709 2729 … … 2725 2745 padding-left: 30px; 2726 2746 } 2727 2747 2728 .site-content .has- featured-image.entry-header,2748 .site-content .has-post-thumbnail .entry-header, 2729 2749 .site-content .format-standard .entry-header { 2730 2750 margin-top: -48px; 2731 2751 } … … 2742 2762 width: 100%; 2743 2763 } 2744 2764 2765 .full-width.singular .content-area { 2766 padding-top: 0; 2767 } 2768 2745 2769 .site-content { 2746 2770 margin-right: 33.33333333%; 2747 2771 } … … 2750 2774 margin-right: 0; 2751 2775 } 2752 2776 2753 .site-content .has- featured-image.entry-header,2777 .site-content .has-post-thumbnail .entry-header, 2754 2778 .site-content .format-standard .entry-header { 2755 2779 margin-top: 0; 2756 2780 } 2757 2781 2758 .full-width .site-content .has- featured-image.entry-header,2782 .full-width .site-content .has-post-thumbnail .entry-header, 2759 2783 .full-width .site-content .format-standard .entry-header { 2760 2784 margin-top: -48px; 2761 2785 } 2762 2786 2787 .full-width.singular .hentry.no-post-thumbnail, 2788 .full-width.singular .hentry.no-post-thumbnail.format-standard.post-password-required { 2789 padding-top: 36px; 2790 } 2791 2792 .full-width.singular .hentry.no-post-thumbnail.format-standard { 2793 padding-top: 0; 2794 } 2795 2763 2796 .archive-header, 2764 2797 .comments-area, 2765 2798 .image-navigation, … … 2982 3015 padding-top: 72px; 2983 3016 } 2984 3017 2985 .site-content .has-featured-image .entry-header, 3018 .full-width.singular .content-area { 3019 padding-top: 0; 3020 } 3021 3022 .full-width.singular .hentry.no-post-thumbnail, 3023 .full-width.singular .hentry.no-post-thumbnail.format-standard.post-password-required { 3024 padding-top: 72px; 3025 } 3026 3027 .full-width.singular .hentry.no-post-thumbnail.format-standard { 3028 padding-top: 0; 3029 } 3030 3031 .site-content .has-post-thumbnail .entry-header, 2986 3032 .site-content .format-standard .entry-header { 2987 3033 margin-top: -48px; 2988 3034 } … … 3041 3087 margin-top: 0; 3042 3088 } 3043 3089 3044 .site-content .has- featured-image.entry-header,3090 .site-content .has-post-thumbnail .entry-header, 3045 3091 .site-content .format-standard .entry-header { 3046 3092 margin-top: 0; 3047 3093 } … … 3202 3248 } 3203 3249 3204 3250 @media screen and (min-width: 1040px) { 3205 .site-content .has- featured-image.entry-header,3251 .site-content .has-post-thumbnail .entry-header, 3206 3252 .site-content .format-standard .entry-header { 3207 3253 margin-top: -48px; 3208 3254 }