Make WordPress Core

Ticket #25718: 25718.diff

File 25718.diff, 11.9 KB (added by iamtakashi, 11 years ago)
  • wp-content/themes/twentyfourteen/content-featured-post.php

     
    1212        <a class="attachment-featured-featured" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">
    1313                <?php
    1414                        if ( has_post_thumbnail() ) :
    15                                 the_post_thumbnail( 'featured-thumbnail-featured' );
     15                                the_post_thumbnail( 'post-thumbnail-grid' );
    1616
    1717                        else :
    1818                                $images = get_children( array(
     
    2626
    2727                                if ( $images ) :
    2828                                        $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' );
    3030                                endif;
    3131                        endif;
    3232                ?>
  • wp-content/themes/twentyfourteen/content-gallery.php

     
    2626
    2727<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    2828        <?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' ); ?>
    3131        </div>
    3232        <?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' ); ?>
    3535        </a>
    3636        <?php endif; ?>
    3737
  • wp-content/themes/twentyfourteen/functions.php

     
    6868        add_theme_support( 'post-thumbnails' );
    6969
    7070        // 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 );
    7473
    7574        // This theme uses wp_nav_menu() in two locations.
    7675        register_nav_menus( array(
     
    361360 *
    362361 * Adds body classes to denote:
    363362 * 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.
    367368 *
    368369 * @since Twenty Fourteen 1.0
    369370 *
     
    391392        if ( is_active_sidebar( 'sidebar-3' ) )
    392393                $classes[] = 'footer-widgets';
    393394
     395        if ( is_singular() )
     396                $classes[] = 'singular';
     397
    394398        return $classes;
    395399}
    396400add_filter( 'body_class', 'twentyfourteen_body_classes' );
     
    399403 * Extend the default WordPress post classes.
    400404 *
    401405 * Adds a post class to denote:
    402  * Non-password protected page with a featured image.
     406 * Non-password protected page with a post thumbnail.
    403407 *
    404408 * @since Twenty Fourteen 1.0
    405409 *
     
    408412 */
    409413function twentyfourteen_post_classes( $classes ) {
    410414        if ( ! post_password_required() && has_post_thumbnail() )
    411                 $classes[] = 'has-featured-image';
     415                $classes[] = 'has-post-thumbnail';
     416        else
     417                $classes[] = 'no-post-thumbnail';
    412418
    413419        return $classes;
    414420}
  • wp-content/themes/twentyfourteen/inc/template-tags.php

     
    159159add_action( 'save_post',     'twentyfourteen_category_transient_flusher' );
    160160
    161161/**
    162  * Displays an optional featured image, with an anchor element
     162 * Displays an optional post thumbnail, with an anchor element
    163163 * when on index views, and a div element when on a single view.
    164164 *
    165165 * @return void
     
    171171        if ( is_singular() ) :
    172172        ?>
    173173
    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' ); ?>
    176176        </div>
    177177
    178178        <?php else : ?>
    179179
    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(); ?>">
    181181        <?php if ( has_post_thumbnail() ) :
    182                 the_post_thumbnail( 'featured-thumbnail-large' );
     182                the_post_thumbnail( 'post-thumbnail' );
    183183        else : ?>
    184184                <p class="screen-reader-text"><?php _e( 'No featured image.', 'twentyfourteen' ); ?></p>
    185185        <?php endif; ?>
  • wp-content/themes/twentyfourteen/inc/widgets.php

     
    137137                                                                $total_images = count( $images );
    138138
    139139                                                                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' );
    141141                                                                elseif ( $total_images > 0 ) :
    142142                                                                        $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' );
    144144                                                                endif;
    145145                                                ?>
    146                                                 <a href="<?php the_permalink(); ?>"><?php echo $featured_image; ?></a>
     146                                                <a href="<?php the_permalink(); ?>"><?php echo $post_thumbnail; ?></a>
    147147                                                <p class="wp-caption-text">
    148148                                                        <?php
    149149                                                                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

     
    361361
    362362/* Mobile list style */
    363363@media screen and (max-width: 400px) {
    364         .list-view .featured-thumbnail img {
     364        .list-view .post-thumbnail img {
    365365                float: right;
    366366                margin: 0 0 3px 10px;
    367367        }
  • wp-content/themes/twentyfourteen/style.css

     
    3535 *   6.9 - Contributor Page
    3636 *   6.10 - 404 Page
    3737 *   6.11 - Front Page
    38  *   6.12 - Comments
     38 *   6.12 - Full-width
     39 *   6.13 - Comments
    3940 * 7.0 - Sidebar
    4041 *   7.1 - Widgets
    4142 *   7.2 - Content Sidebar Widgets
     
    561562}
    562563
    563564.attachment-featured-featured img,
    564 .featured-thumbnail img {
     565.post-thumbnail img {
    565566        height: auto;
    566567        max-width: 100%;
    567568}
     
    984985        max-width: 672px;
    985986}
    986987
    987 .full-width .hentry {
    988         max-width: 100%;
    989 }
    990 
    991988.site-content .entry-header,
    992989.site-content .entry-content,
    993990.site-content .entry-summary,
     
    10031000 * -----------------------------------------------------------------------------
    10041001 */
    10051002
    1006  .featured-thumbnail {
     1003 .post-thumbnail {
    10071004        background: url(images/pattern-light.svg) #767676 repeat fixed;
    10081005        display: none;
    10091006        float: none;
     
    10151012        z-index: 0;
    10161013}
    10171014
    1018 a.featured-thumbnail:hover {
     1015a.post-thumbnail:hover {
    10191016        background: url(images/pattern-light.svg) #919191 repeat fixed;
    10201017}
    10211018
    1022 .featured-thumbnail img {
     1019.post-thumbnail img {
    10231020        display: block;
    10241021        margin: 0 auto;
    10251022}
    10261023
    1027 .has-featured-image .featured-thumbnail,
    1028 .format-standard .featured-thumbnail {
     1024.has-post-thumbnail .post-thumbnail,
     1025.format-standard .post-thumbnail {
    10291026        display: block;
    10301027}
    10311028
     
    10451042        padding: 0 10px 12px;
    10461043}
    10471044
    1048 .site-content .has-featured-image .entry-header,
     1045.site-content .has-post-thumbnail .entry-header,
    10491046.site-content .format-standard .entry-header {
    10501047        padding-top: 24px;
    10511048}
     
    17431740
    17441741
    17451742/**
    1746  * 6.11 Comments
     1743 * 6.12 Full-width
    17471744 * -----------------------------------------------------------------------------
    17481745 */
    17491746
     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
    17501770.comments-area {
    17511771        margin: 48px auto;
    17521772        max-width: 474px;
     
    25302550 */
    25312551
    25322552@media screen and (max-width: 400px) {
    2533         .list-view .featured-thumbnail {
     2553        .list-view .post-thumbnail {
    25342554                background: none;
    25352555                min-height: 0;
    25362556                width: auto;
    25372557                z-index: 2;
    25382558        }
    25392559
    2540         .list-view .featured-thumbnail img {
     2560        .list-view .post-thumbnail img {
    25412561                float: left;
    25422562                margin: 0 10px 3px 0;
    25432563                width: 84px;
     
    26002620}
    26012621
    26022622@media screen and (min-width: 401px) {
    2603         a.featured-thumbnail:hover img {
     2623        a.post-thumbnail:hover img {
    26042624                opacity: 0.85;
    26052625        }
    26062626
     
    27022722                margin: -3px 2px 0 0;
    27032723        }
    27042724
    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 {
    27072727                margin-top: -49px;
    27082728        }
    27092729
     
    27252745                padding-left: 30px;
    27262746        }
    27272747
    2728         .site-content .has-featured-image .entry-header,
     2748        .site-content .has-post-thumbnail .entry-header,
    27292749        .site-content .format-standard .entry-header {
    27302750                margin-top: -48px;
    27312751        }
     
    27422762                width: 100%;
    27432763        }
    27442764
     2765        .full-width.singular .content-area {
     2766                padding-top: 0;
     2767        }
     2768
    27452769        .site-content {
    27462770                margin-right: 33.33333333%;
    27472771        }
     
    27502774                margin-right: 0;
    27512775        }
    27522776
    2753         .site-content .has-featured-image .entry-header,
     2777        .site-content .has-post-thumbnail .entry-header,
    27542778        .site-content .format-standard .entry-header {
    27552779                margin-top: 0;
    27562780        }
    27572781
    2758         .full-width .site-content .has-featured-image .entry-header,
     2782        .full-width .site-content .has-post-thumbnail .entry-header,
    27592783        .full-width .site-content .format-standard .entry-header {
    27602784                margin-top: -48px;
    27612785        }
    27622786
     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
    27632796        .archive-header,
    27642797        .comments-area,
    27652798        .image-navigation,
     
    29823015                padding-top: 72px;
    29833016        }
    29843017
    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,
    29863032        .site-content .format-standard .entry-header {
    29873033                margin-top: -48px;
    29883034        }
     
    30413087                margin-top: 0;
    30423088        }
    30433089
    3044         .site-content .has-featured-image .entry-header,
     3090        .site-content .has-post-thumbnail .entry-header,
    30453091        .site-content .format-standard .entry-header {
    30463092                margin-top: 0;
    30473093        }
     
    32023248}
    32033249
    32043250@media screen and (min-width: 1040px) {
    3205         .site-content .has-featured-image .entry-header,
     3251        .site-content .has-post-thumbnail .entry-header,
    32063252        .site-content .format-standard .entry-header {
    32073253                margin-top: -48px;
    32083254        }