Make WordPress Core

Changeset 26034


Ignore:
Timestamp:
11/07/2013 05:28:56 PM (13 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: remove the pattern image used as a placeholder for featured images. This greatly improves the "first run" experience of the theme and gives it a more general appeal as a blog theme by putting less of a requirement on featured images. Props iamtakashi, fixes #25859.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/inc/template-tags.php

    r26026 r26034  
    166166*/
    167167function twentyfourteen_post_thumbnail() {
    168         if ( post_password_required() )
     168        if ( post_password_required() || ! has_post_thumbnail() )
    169169                return;
    170170
     
    173173
    174174        <div class="post-thumbnail">
    175                 <?php
    176                         if ( is_active_sidebar( 'sidebar-2' ) || wp_is_mobile() )
    177                                 the_post_thumbnail( 'post-thumbnail' );
    178                         else
    179                                 the_post_thumbnail( 'post-thumbnail-full-width' );
    180                 ?>
     175        <?php
     176                if ( is_active_sidebar( 'sidebar-2' ) || wp_is_mobile() )
     177                        the_post_thumbnail( 'post-thumbnail' );
     178                else
     179                        the_post_thumbnail( 'post-thumbnail-full-width' );
     180        ?>
    181181        </div>
    182182
     
    184184
    185185        <a class="post-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">
    186         <?php if ( has_post_thumbnail() && ( is_active_sidebar( 'sidebar-2' ) || wp_is_mobile() ) ) :
    187                 the_post_thumbnail( 'post-thumbnail' );
    188         elseif ( has_post_thumbnail() ) :
    189                 the_post_thumbnail( 'post-thumbnail-full-width' );
    190         else : ?>
    191                 <p class="screen-reader-text"><?php _e( 'No featured image.', 'twentyfourteen' ); ?></p>
    192         <?php endif; ?>
     186        <?php
     187                if ( is_active_sidebar( 'sidebar-2' ) || wp_is_mobile() )
     188                        the_post_thumbnail( 'post-thumbnail' );
     189                else
     190                        the_post_thumbnail( 'post-thumbnail-full-width' );
     191        ?>
    193192        </a>
    194193
  • trunk/src/wp-content/themes/twentyfourteen/style.css

    r26023 r26034  
    999999
    10001000.hentry {
    1001         margin-bottom: 36px;
     1001        margin-bottom: 48px;
    10021002        max-width: 672px;
    10031003}
     
    10121012}
    10131013
     1014.page-content {
     1015        margin-bottom: 48px;
     1016}
     1017
     1018.hentry > :last-child {
     1019        margin-bottom: 0
     1020}
     1021
    10141022
    10151023/**
     
    10181026 */
    10191027
    1020  .post-thumbnail {
    1021         background: #767676 url(images/pattern-light.svg) repeat fixed;
    1022         display: none;
    1023         height: auto;
    1024         margin: 0;
    1025         min-height: 192px;
     1028.post-thumbnail {
     1029        background: #b2b2b2 url(images/pattern-light.svg) repeat fixed;
     1030        display: block;
    10261031        position: relative;
    10271032        width: 100%;
     
    10301035
    10311036a.post-thumbnail:hover {
    1032         background-color: #919191;
    1033 }
    1034 
    1035 .post-thumbnail img {
     1037        background-color: #999;
     1038}
     1039
     1040.full-width .post-thumbnail img {
    10361041        display: block;
    10371042        margin: 0 auto;
    1038 }
    1039 
    1040 .has-post-thumbnail .post-thumbnail,
    1041 .format-standard .post-thumbnail {
    1042         display: block;
    10431043}
    10441044
     
    10761076}
    10771077
    1078 .site-content .has-post-thumbnail .entry-header,
    1079 .site-content .format-standard .entry-header {
     1078.site-content .has-post-thumbnail .entry-header {
    10801079        padding-top: 24px;
    1081 }
    1082 
    1083 .site-content .format-standard.post-password-required .entry-header {
    1084         padding-top: 0;
    10851080}
    10861081
     
    11451140
    11461141.site-content footer.entry-meta:empty {
    1147         margin-top: 0;
    1148         margin-bottom: 0;
     1142        margin: 0;
    11491143}
    11501144
     
    11601154        font-weight: 700;
    11611155        line-height: 1.2727272727;
    1162         margin: 0 4px 4px 10px;
     1156        margin: 2px 4px 2px 10px;
    11631157        padding: 3px 7px;
    11641158        position: relative;
     
    13211315        font-weight: 900;
    13221316        line-height: 2;
    1323         margin-bottom: 24px;
     1317        margin: 24px 0;
    13241318        text-transform: uppercase;
    13251319}
     
    15791573.paging-navigation {
    15801574        border-top: 5px solid #000;
    1581         margin: 36px 0;
     1575        margin: 48px 0;
    15821576}
    15831577
     
    16411635.archive-header,
    16421636.page-header {
    1643         margin: 0 auto 12px;
     1637        margin: 24px auto;
    16441638        max-width: 474px;
    16451639}
     
    16571651        font-size: 14px;
    16581652        line-height: 1.2857142857;
     1653}
     1654
     1655.taxonomy-description p {
    16591656        margin-bottom: 18px;
     1657}
     1658
     1659.taxonomy-description p:last-child {
     1660        margin-bottom: 0;
    16601661}
    16611662
     
    17461747 */
    17471748
    1748 .singular .hentry.format-standard,
    17491749.singular .hentry.has-post-thumbnail {
    17501750        margin-top: -24px;
    1751 }
    1752 
    1753 .singular .hentry.format-standard.post-password-required {
    1754         margin-top: 0
    17551751}
    17561752
     
    26982694.featured-content .post-thumbnail {
    26992695        display: block;
    2700         min-height: 0;
    27012696        position: relative;
    27022697        padding-top: 55.357142857%;
     
    28692864        .list-view .site-content .post-thumbnail {
    28702865                background: none;
    2871                 min-height: 0;
    28722866                width: auto;
    28732867                z-index: 2;
     
    29282922        .page-header {
    29292923                border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    2930                 padding-top: 12px;
     2924                margin: 24px auto 0;
     2925                padding-bottom: 24px;
    29312926        }
    29322927
    29332928        .error404 .page-header {
    29342929                border-bottom: 0;
     2930                margin: 0 auto 24px;
    29352931                padding: 0 10px;
    29362932        }
     
    30473043        }
    30483044
    3049         .list-view .site-content .has-post-thumbnail .post-thumbnail,
    3050         .list-view .site-content .format-standard .post-thumbnail {
    3051                 margin-top: -49px;
    3052         }
    3053 
    30543045        .list-view .site-content .hentry {
    30553046                border-top: 1px solid rgba(0, 0, 0, 0.1);
    3056                 padding-top: 48px;
     3047                padding-top: 60px;
     3048        }
     3049
     3050        .list-view .site-content .hentry:first-child,
     3051        .list-view .site-content .hentry:first-of-type,
     3052        .list-view .site-content .hentry.has-post-thumbnail {
     3053                border-top: 0;
     3054                padding-top: 0;
    30573055        }
    30583056
    30593057        .archive-header,
    30603058        .page-header {
     3059                margin: 0 auto 60px;
     3060                padding: 0 10px;
     3061        }
     3062
     3063        .error404 .page-header {
    30613064                margin-bottom: 24px;
    3062                 padding: 0 10px;
     3065        }
     3066
     3067        .featured-content {
     3068                margin-bottom: 48px;
    30633069        }
    30643070}
     
    30703076        }
    30713077
    3072         .site-content .has-post-thumbnail .entry-header,
    3073         .site-content .format-standard .entry-header {
     3078        .site-content .has-post-thumbnail .entry-header {
    30743079                margin-top: -48px;
    3075         }
    3076 
    3077         .site-content .format-standard.post-password-required .entry-header {
    3078                 margin-top: 0;
    30793080        }
    30803081}
     
    30953096        .content-area {
    30963097                float: left;
    3097                 padding-top: 36px;
     3098                padding-top: 48px;
    30983099                width: 100%;
    30993100        }
     
    31033104        }
    31043105
    3105         .site-content .has-post-thumbnail .entry-header,
    3106         .site-content .format-standard .entry-header {
     3106        .site-content .has-post-thumbnail .entry-header {
    31073107                margin-top: 0;
    31083108        }
     
    31213121        }
    31223122
    3123         .singular .hentry.format-standard,
    3124         .singular .hentry.has-post-thumbnail,
    3125         .singular .hentry.format-standard.post-password-required {
     3123        .singular .hentry.has-post-thumbnail {
    31263124                margin-top: 0
    31273125        }
     
    31313129        }
    31323130
    3133         .full-width .site-content .has-post-thumbnail .entry-header,
    3134         .full-width .site-content .format-standard .entry-header {
     3131        .full-width .site-content .has-post-thumbnail .entry-header {
    31353132                margin-top: -48px;
    31363133        }
    31373134
    3138         .full-width .site-content .format-standard.post-password-required .entry-header {
    3139                 margin-top: 0
    3140         }
    3141 
    3142         .full-width.singular .hentry.format-standard,
    31433135        .full-width.singular .hentry.has-post-thumbnail {
    3144                 margin-top: -36px;
    3145         }
    3146 
    3147         .full-width.singular .hentry.format-standard.post-password-required {
    3148                 margin-top: 0
     3136                margin-top: -48px;
    31493137        }
    31503138
     
    31583146                float: right;
    31593147                margin-left: -33.33333333%;
    3160                 padding: 36px 30px 24px;
     3148                padding: 48px 30px 24px;
    31613149                width: 33.33333333%;
     3150        }
     3151
     3152        .featured-content {
     3153                margin-bottom: 24px;
    31623154        }
    31633155
     
    34073399        }
    34083400
    3409         .site-content .has-post-thumbnail .entry-header,
    3410         .site-content .format-standard .entry-header {
     3401        .site-content .has-post-thumbnail .entry-header {
    34113402                margin-top: -48px;
    3412         }
    3413 
    3414         .site-content .format-standard.post-password-required .entry-header {
    3415                 margin-top: 0;
    34163403        }
    34173404
     
    34403427        }
    34413428
    3442         .full-width.singular .hentry.format-standard,
    34433429        .full-width.singular .hentry.has-post-thumbnail {
    34443430                margin-top: -72px;
    34453431        }
    34463432
    3447         .full-width.singular .hentry.format-standard.post-password-required {
    3448                 margin-top: 0
    3449         }
    3450 
    34513433        .featured-content {
    3452                 margin-bottom: -24px;
     3434                margin-bottom: 0
    34533435        }
    34543436}
     
    34723454        }
    34733455
    3474         .site-content .has-post-thumbnail .entry-header,
    3475         .site-content .format-standard .entry-header {
     3456        .site-content .has-post-thumbnail .entry-header {
    34763457                margin-top: 0;
    34773458        }
     
    37283709
    37293710@media screen and (min-width: 1040px) {
    3730         .site-content .has-post-thumbnail .entry-header,
    3731         .site-content .format-standard .entry-header {
     3711        .site-content .has-post-thumbnail .entry-header {
    37323712                margin-top: -48px;
    3733         }
    3734 
    3735         .site-content .format-standard.post-password-required .entry-header {
    3736                 margin-top: 0;
    37373713        }
    37383714
     
    39893965        }
    39903966
    3991         .post-thumbnail {
    3992                 min-height: 0;
    3993         }
    3994 
    39953967        .post-thumbnail img {
    39963968                margin: 0 10px 24px;
    39973969        }
    39983970
    3999         .site-content .has-post-thumbnail .entry-header,
    4000         .site-content .format-standard .entry-header {
     3971        .site-content .has-post-thumbnail .entry-header {
    40013972                padding-top: 0;
    40023973        }
     
    40103981        }
    40113982
    4012         .singular .hentry.format-standard,
    40133983        .singular .hentry.has-post-thumbnail {
    40143984                margin-top: 0;
Note: See TracChangeset for help on using the changeset viewer.