Make WordPress Core

Changeset 25971


Ignore:
Timestamp:
10/28/2013 05:57:57 PM (10 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: clean up post thumbnail naming. Props iamtakashi, fixes #25718.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/content-featured-post.php

    r25804 r25971  
    1313        <?php
    1414            if ( has_post_thumbnail() ) :
    15                 the_post_thumbnail( 'featured-thumbnail-featured' );
     15                the_post_thumbnail( 'post-thumbnail-grid' );
    1616
    1717            else :
     
    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;
  • trunk/src/wp-content/themes/twentyfourteen/functions.php

    r25864 r25971  
    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.
     
    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
     
    392393        $classes[] = 'footer-widgets';
    393394
     395    if ( is_singular() )
     396        $classes[] = 'singular';
     397
    394398    return $classes;
    395399}
     
    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
     
    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;
  • trunk/src/wp-content/themes/twentyfourteen/inc/template-tags.php

    r25856 r25971  
    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 *
     
    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>
  • trunk/src/wp-content/themes/twentyfourteen/rtl.css

    r25864 r25971  
    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;
  • trunk/src/wp-content/themes/twentyfourteen/style.css

    r25969 r25971  
    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
     
    562563
    563564.attachment-featured-featured img,
    564 .featured-thumbnail img {
     565.post-thumbnail img {
    565566    height: auto;
    566567    max-width: 100%;
     
    985986}
    986987
    987 .full-width .hentry {
    988     max-width: 100%;
    989 }
    990 
    991988.site-content .entry-header,
    992989.site-content .entry-content,
     
    10041001 */
    10051002
    1006  .featured-thumbnail {
     1003 .post-thumbnail {
    10071004    background: url(images/pattern-light.svg) #767676 repeat fixed;
    10081005    display: none;
     
    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}
     
    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;
     
    17331730
    17341731/**
    1735  * 6.11 Comments
     1732 * 6.12 Full-width
     1733 * -----------------------------------------------------------------------------
     1734 */
     1735
     1736.full-width.singular .content-area {
     1737    padding-top: 0;
     1738}
     1739
     1740.full-width .hentry {
     1741    max-width: 100%;
     1742}
     1743
     1744.full-width.singular .hentry.no-post-thumbnail,
     1745.full-width.singular .hentry.no-post-thumbnail.format-standard.post-password-required {
     1746    padding-top: 24px;
     1747}
     1748
     1749.full-width.singular .hentry.no-post-thumbnail.format-standard {
     1750    padding-top: 0;
     1751}
     1752
     1753
     1754/**
     1755 * 6.13 Comments
    17361756 * -----------------------------------------------------------------------------
    17371757 */
     
    25202540
    25212541@media screen and (max-width: 400px) {
    2522     .list-view .featured-thumbnail {
     2542    .list-view .post-thumbnail {
    25232543        background: none;
    25242544        min-height: 0;
     
    25272547    }
    25282548
    2529     .list-view .featured-thumbnail img {
     2549    .list-view .post-thumbnail img {
    25302550        float: left;
    25312551        margin: 0 10px 3px 0;
     
    25902610
    25912611@media screen and (min-width: 401px) {
    2592     a.featured-thumbnail:hover img {
     2612    a.post-thumbnail:hover img {
    25932613        opacity: 0.85;
    25942614    }
     
    26922712    }
    26932713
    2694     .list-view .site-content .has-featured-image .featured-thumbnail,
    2695     .list-view .site-content .format-standard .featured-thumbnail {
     2714    .list-view .site-content .has-post-thumbnail .post-thumbnail,
     2715    .list-view .site-content .format-standard .post-thumbnail {
    26962716        margin-top: -49px;
    26972717    }
     
    27152735    }
    27162736
    2717     .site-content .has-featured-image .entry-header,
     2737    .site-content .has-post-thumbnail .entry-header,
    27182738    .site-content .format-standard .entry-header {
    27192739        margin-top: -48px;
     
    27322752    }
    27332753
     2754    .full-width.singular .content-area {
     2755        padding-top: 0;
     2756    }
     2757
    27342758    .site-content {
    27352759        margin-right: 33.33333333%;
     
    27402764    }
    27412765
    2742     .site-content .has-featured-image .entry-header,
     2766    .site-content .has-post-thumbnail .entry-header,
    27432767    .site-content .format-standard .entry-header {
    27442768        margin-top: 0;
    27452769    }
    27462770
    2747     .full-width .site-content .has-featured-image .entry-header,
     2771    .full-width .site-content .has-post-thumbnail .entry-header,
    27482772    .full-width .site-content .format-standard .entry-header {
    27492773        margin-top: -48px;
     2774    }
     2775
     2776    .full-width.singular .hentry.no-post-thumbnail,
     2777    .full-width.singular .hentry.no-post-thumbnail.format-standard.post-password-required {
     2778        padding-top: 36px;
     2779    }
     2780
     2781    .full-width.singular .hentry.no-post-thumbnail.format-standard {
     2782        padding-top: 0;
    27502783    }
    27512784
     
    29723005    }
    29733006
    2974     .site-content .has-featured-image .entry-header,
     3007    .full-width.singular .content-area {
     3008        padding-top: 0;
     3009    }
     3010
     3011    .full-width.singular .hentry.no-post-thumbnail,
     3012    .full-width.singular .hentry.no-post-thumbnail.format-standard.post-password-required {
     3013        padding-top: 72px;
     3014    }
     3015
     3016    .full-width.singular .hentry.no-post-thumbnail.format-standard {
     3017        padding-top: 0;
     3018    }
     3019
     3020    .site-content .has-post-thumbnail .entry-header,
    29753021    .site-content .format-standard .entry-header {
    29763022        margin-top: -48px;
     
    30313077    }
    30323078
    3033     .site-content .has-featured-image .entry-header,
     3079    .site-content .has-post-thumbnail .entry-header,
    30343080    .site-content .format-standard .entry-header {
    30353081        margin-top: 0;
     
    31923238
    31933239@media screen and (min-width: 1040px) {
    3194     .site-content .has-featured-image .entry-header,
     3240    .site-content .has-post-thumbnail .entry-header,
    31953241    .site-content .format-standard .entry-header {
    31963242        margin-top: -48px;
Note: See TracChangeset for help on using the changeset viewer.