Make WordPress Core

Ticket #25325: 25325.4.diff

File 25325.4.diff, 15.4 KB (added by iamtakashi, 11 years ago)
  • wp-content/themes/twentyfourteen/content-aside.php

     
    88?>
    99
    1010<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     11        <?php twentyfourteen_featured_thumbnail(); ?>
     12
    1113        <header class="entry-header">
    1214                <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    1315                <div class="entry-meta">
  • wp-content/themes/twentyfourteen/content-image.php

     
    88?>
    99
    1010<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     11        <?php twentyfourteen_featured_thumbnail(); ?>
     12
    1113        <header class="entry-header">
    1214                <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    1315                <div class="entry-meta">
  • wp-content/themes/twentyfourteen/content-link.php

     
    88?>
    99
    1010<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     11        <?php twentyfourteen_featured_thumbnail(); ?>
     12
    1113        <header class="entry-header">
    1214                <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    1315                <div class="entry-meta">
  • wp-content/themes/twentyfourteen/content-page.php

     
    88?>
    99
    1010<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     11        <?php twentyfourteen_featured_thumbnail(); ?>
     12
    1113        <?php the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' ); ?>
    1214
    1315        <div class="entry-content">
  • wp-content/themes/twentyfourteen/content-quote.php

     
    88?>
    99
    1010<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     11        <?php twentyfourteen_featured_thumbnail(); ?>
     12
    1113        <header class="entry-header">
    1214                <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    1315                <div class="entry-meta">
  • wp-content/themes/twentyfourteen/content-video.php

     
    88?>
    99
    1010<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     11        <?php twentyfourteen_featured_thumbnail(); ?>
     12
    1113        <header class="entry-header">
    1214                <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    1315                <div class="entry-meta">
  • wp-content/themes/twentyfourteen/content.php

     
    33 * @package WordPress
    44 * @subpackage Twenty_Fourteen
    55 */
    6 
    76?>
    87
    98<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    10         <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyfourteen' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="<?php the_ID(); ?>" class="attachment-featured-thumbnail">
    11                 <?php the_post_thumbnail( 'featured-thumbnail-large' ); ?>
    12         </a>
     9        <?php twentyfourteen_featured_thumbnail(); ?>
    1310
    1411        <header class="entry-header">
    1512                <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
  • wp-content/themes/twentyfourteen/functions.php

     
    5959        add_theme_support( 'automatic-feed-links' );
    6060
    6161        // Enable support for Post Thumbnails.
    62         add_theme_support( 'post-thumbnails', array( 'post' ) );
     62        add_theme_support( 'post-thumbnails' );
    6363
    6464        // Adding several sizes for Post Thumbnails.
    6565        add_image_size( 'featured-thumbnail-large', 672, 0 );
     
    481481add_filter( 'body_class', 'twentyfourteen_body_classes' );
    482482
    483483/**
     484 * Extends the default WordPress post classes.
     485 *
     486 * Adds a post class to denote:
     487 * Non-password protected page with a featured image.
     488 *
     489 * @param array $classes A list of existing post class values.
     490 * @return array The filtered post class list.
     491 */
     492function twentyfourteen_post_classes( $classes ) {
     493        if ( ! post_password_required() && has_post_thumbnail() )
     494                $classes[] = 'has-featured-image';
     495
     496        return $classes;
     497}
     498add_filter( 'post_class', 'twentyfourteen_post_classes' );
     499
     500/**
    484501 * Creates a nicely formatted and more specific title element text for output
    485502 * in head of document, based on current view.
    486503 *
  • wp-content/themes/twentyfourteen/inc/template-tags.php

     
    143143}
    144144add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' );
    145145add_action( 'save_post',     'twentyfourteen_category_transient_flusher' );
     146
     147/**
     148 * Displays featured image with appropriate html tag.
     149 *
     150 * @return void
     151 */
     152function twentyfourteen_featured_thumbnail() {
     153        if ( ! post_password_required() ) :
     154                if ( has_post_thumbnail() && is_singular() ) :
     155                ?>
     156                        <div class="attachment-featured-thumbnail">
     157                                <?php the_post_thumbnail( 'featured-thumbnail-large' ); ?>
     158                        </div>
     159                <?php
     160                else :
     161                ?>
     162                        <a href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>" class="attachment-featured-thumbnail">
     163                                <?php the_post_thumbnail( 'featured-thumbnail-large' ); ?>
     164                        </a>
     165                <?php
     166                endif;
     167        endif;
     168}
     169 No newline at end of file
  • wp-content/themes/twentyfourteen/style.css

     
    453453/* Clearing */
    454454.clear:before,
    455455.clear:after,
     456.hentry:before,
     457.hentry:after,
    456458[class*="content"]:before,
    457459[class*="content"]:after,
    458460[class*="site"]:before,
     
    462464}
    463465
    464466.clear:after,
     467.hentry:after,
    465468[class*="content"]:after,
    466469[class*="site"]:after {
    467470        clear: both;
     
    809812        background-image: -webkit-linear-gradient(135deg, #767676 12.5%, #fff 12.5%, #fff 50%, #767676 50%, #767676 62.5%, #fff 62.5%);
    810813        background-image:         linear-gradient(135deg, #767676 12.5%, #fff 12.5%, #fff 50%, #767676 50%, #767676 62.5%, #fff 62.5%);
    811814        background-size: 4px 4px;
    812         display: block;
     815        display: none;
    813816        float: none;
    814817        margin: 0;
    815818        min-height: 180px;
     
    818821        height: auto;
    819822        z-index: 0;
    820823}
     824.has-featured-image .attachment-featured-thumbnail,
     825.format-standard .attachment-featured-thumbnail {
     826        display: block;
     827}
    821828.attachment-featured-thumbnail:hover {
    822829        background: #919191;
    823830        background-attachment: fixed;
     
    825832        background-image:         linear-gradient(135deg, #919191 12.5%, #fff 12.5%, #fff 50%, #919191 50%, #919191 62.5%, #fff 62.5%);
    826833        background-size: 4px 4px;
    827834}
    828 .full-width .attachment-featured-thumbnail img {
     835.attachment-featured-thumbnail img {
    829836        display: block;
    830837        margin: 0 auto;
    831838}
     
    940947/* .content-area specific styles */
    941948.content-area .entry-header,
    942949.content-area .entry-content,
    943 .content-area .page-content,
    944950.content-area .entry-summary,
    945 .content-area .entry-meta {
     951.content-area .entry-meta,
     952.page-content {
    946953        margin: 0 auto;
    947954        max-width: 474px;
    948955}
    949956.content-area .entry-header {
    950957        background-color: #fff;
    951         padding: 24px 10px 12px;
     958        padding: 0 10px 12px;
    952959}
     960.content-area .has-featured-image .entry-header,
     961.content-area .format-standard .entry-header {
     962        padding-top: 24px;
     963}
     964.content-area .format-standard.post-password-required .entry-header {
     965        padding-top: 0;
     966}
    953967.content-area .entry-title {
    954968        font-size: 33px;
    955969        font-weight: 300;
     
    963977        text-transform: uppercase;
    964978}
    965979.content-area .entry-content,
    966 .content-area .page-content,
    967 .content-area .entry-summary {
     980.content-area .entry-summary,
     981.page-content {
    968982        background-color: #fff;
    969983        padding: 12px 10px 0;
    970984}
     
    973987        padding: 0 10px;
    974988}
    975989.content-area footer.entry-meta {
    976         margin-bottom: 36px;
     990        margin-bottom: 24px;
    977991}
    978992.content-area footer.entry-meta .entry-title {
    979993        font-size: 12px;
     
    9881002footer.entry-meta .entry-title a:hover {
    9891003        color: #2b2b2b;
    9901004}
    991 .format-aside,
    992 .format-quote,
    993 .format-link,
    994 .format-image,
    995 .format-video {
    996         border-top: 1px solid rgba(0, 0, 0, 0.1);
    997 }
    9981005.format-aside .entry-content,
    9991006.format-aside .entry-summary,
    10001007.format-quote .entry-content,
     
    10031010.format-link.entry-summary {
    10041011        padding-top: 0;
    10051012}
    1006 
    1007 /* Single specific styles */
    1008 .single .format-aside .entry-header,
    1009 .single .format-quote .entry-header,
    1010 .single .format-link .entry-header,
    1011 .single .format-image .entry-header,
    1012 .single .format-video .entry-header {
    1013         padding-top: 0;
    1014 }
    1015 .single .format-aside,
    1016 .single .format-quote,
    1017 .single .format-link,
    1018 .single .format-image,
    1019 .single .format-video {
    1020         border-top: none;
    1021 }
    1022 
    10231013/* Page specific styles */
    10241014.page .entry-content,
    10251015.error404 .page-header,
     
    11511141        font-size: 16px;
    11521142        font-weight: 900;
    11531143        line-height: 1.5;
    1154         margin-bottom: 24px;
     1144        margin: 0 0 24px;
    11551145}
    11561146.taxonomy-description {
    11571147        color: #767676;
     
    15791569}
    15801570.post-navigation,
    15811571.image-navigation {
    1582         margin: 24px auto;
     1572        margin: 24px auto 48px;
    15831573        max-width: 474px;
    15841574        padding: 0 10px;
    15851575}
     
    16481638----------------------------------------------- */
    16491639
    16501640.comments-area {
    1651         margin: 36px auto;
     1641        margin: 48px auto;
    16521642        max-width: 474px;
    16531643        padding: 0 10px;
    16541644}
     
    22012191                margin: 0;
    22022192                text-transform: none;
    22032193        }
    2204         .list-view .content-area .format-aside,
    2205         .list-view .content-area .format-quote,
    2206         .list-view .content-area .format-link,
    2207         .list-view .content-area .format-image,
    2208         .list-view .content-area .format-video {
    2209                 border-top: 0;
    2210         }
    22112194        .list-view .content-area .format-aside .entry-title,
    22122195        .list-view .content-area .format-quote .entry-title,
    22132196        .list-view .content-area .format-link .entry-title {
     
    22252208}
    22262209
    22272210@media screen and (min-width: 401px) {
    2228         .attachment-featured-thumbnail:hover img {
     2211        a.attachment-featured-thumbnail:hover img {
    22292212                opacity: 0.85;
    22302213        }
    22312214        .content-area span + .entry-date:before,
     
    23082291                margin-bottom: 24px;
    23092292                padding: 0 10px;
    23102293        }
    2311         .search-results .content-area .type-page {
     2294        .list-view .content-area .hentry {
    23122295                border-top: 1px solid rgba(0, 0, 0, 0.1);
     2296                padding-top: 48px;
    23132297        }
    2314         .search-results .content-area .type-page .entry-header {
    2315                 margin-top: 24px;
     2298        .list-view .content-area .has-featured-image .attachment-featured-thumbnail,
     2299        .list-view .content-area .format-standard .attachment-featured-thumbnail {
     2300                margin-top: -49px;
    23162301        }
    23172302}
    23182303
    23192304@media screen and (min-width: 642px) {
    23202305        .content-area .entry-header {
    2321                 margin-top: -48px;
    23222306                padding-right: 30px;
    23232307                padding-left: 30px;
    23242308        }
    2325         .attachment .content-area .entry-header {
     2309        .content-area .has-featured-image .entry-header,
     2310        .content-area .format-standard .entry-header {
     2311                margin-top: -48px;
     2312        }
     2313        .content-area .format-standard.post-password-required .entry-header {
    23262314                margin-top: 0;
    23272315        }
    23282316}
     
    23362324        .site-content {
    23372325                margin-right: 33.33333333%;
    23382326        }
    2339         .content-area .entry-header {
     2327        .content-area .has-featured-image .entry-header,
     2328        .content-area .format-standard .entry-header {
    23402329                margin-top: 0;
    23412330        }
    23422331        .content-area .entry-content,
     
    23782367        .full-width .site-content {
    23792368                margin-right: 0;
    23802369        }
     2370        .full-width .content-area .has-featured-image .entry-header,
     2371        .full-width .content-area .format-standard .entry-header {
     2372                margin-top: -48px;
     2373        }
    23812374}
    23822375
    23832376@media screen and (min-width: 770px) {
     
    24102403                margin-left: -168px;
    24112404                max-width: 810px;
    24122405        }
    2413         .single-attachment .entry-content .attachment {
    2414                 text-align: center;
     2406        .single-attachment .entry-content .attachment img {
     2407                margin: 0 auto;
    24152408        }
    24162409        .full-width .entry-content blockquote.alignleft,
    24172410        .full-width .entry-content blockquote.alignright {
     
    24272420}
    24282421
    24292422@media screen and (min-width: 870px) {
    2430         .content-area {
     2423        .content-area,
     2424        .content-sidebar,
     2425        .ephemera {
    24312426                padding-top: 72px;
    24322427        }
    2433         .home .content-area {
    2434                 padding-top: 36px;
    2435         }
    2436         .content-area .entry-header {
     2428        .content-area .has-featured-image .entry-header,
     2429        .content-area .format-standard .entry-header {
    24372430                margin-top: -48px;
    24382431        }
    2439         .content-area .format-aside .entry-header,
    2440         .content-area .format-quote .entry-header,
    2441         .content-area .format-link .entry-header,
    2442         .content-area .format-video .entry-header,
    2443         .content-area .format-image .entry-header {
    2444                 margin-top: 12px;
    2445         }
    2446         .single .content-area .format-aside .entry-header,
    2447         .single .content-area .format-quote .entry-header,
    2448         .single .content-area .format-link .entry-header,
    2449         .single .content-area .format-image .entry-header,
    2450         .single .content-area .format-video .entry-header {
     2432        .content-area .format-standard.post-password-required .entry-header {
    24512433                margin-top: 0;
    24522434        }
    24532435        .comments-area article,
     
    25052487        .content-area .entry-header {
    25062488                margin-top: 0;
    25072489        }
    2508         .content-area .entry-header
    2509         .content-area .entry-content,
    2510         .content-area .entry-summary,
    2511         .content-area footer.entry-meta,
    2512         .archive-header,
    2513         .page-header,
    2514         .page-content,
    2515         .post-navigation,
    2516         .image-navigation,
    2517         .comments-area {
    2518                 padding-right: 0;
    2519                 padding-left: 0;
    2520         }
    25212490        .site-footer {
    25222491                padding-left: 27px;
    25232492        }
     
    26032572        .featured-content {
    26042573                padding-left: 182px;
    26052574        }
     2575        .content-area .has-featured-image .entry-header,
     2576        .content-area .format-standard .entry-header {
     2577                margin-top: 0;
     2578        }
    26062579}
    26072580
    26082581@media screen and (min-width: 1040px) {
    2609         .content-area .entry-header {
     2582        .content-area .has-featured-image .entry-header,
     2583        .content-area .format-standard .entry-header {
    26102584                margin-top: -48px;
    26112585        }
     2586        .content-area .format-standard.post-password-required .entry-header {
     2587                margin-top: 0;
     2588        }
    26122589        .content-area .entry-header,
    26132590        .content-area .entry-content,
    26142591        .content-area .entry-summary,
     
    26222599                padding-right: 15px;
    26232600                padding-left: 15px;
    26242601        }
     2602        .full-width .content-area .entry-header,
     2603        .full-width .content-area .entry-content,
     2604        .full-width .content-area .entry-summary,
     2605        .full-width .content-area footer.entry-meta,
     2606        .full-width .archive-header,
     2607        .full-width .page-header,
     2608        .full-width .page-content,
     2609        .full-width .post-navigation,
     2610        .full-width .image-navigation,
     2611        .full-width .comments-area {
     2612                padding-right: 30px;
     2613                padding-left: 30px;
     2614        }
    26252615}
    26262616
    26272617@media screen and (min-width: 1080px) {