WordPress.org

Make WordPress Core

Changeset 24391


Ignore:
Timestamp:
05/31/2013 05:45:00 PM (8 years ago)
Author:
lancewillett
Message:

Twenty Thirteen: remove all post_format_*() and the_remaining_content() function calls, reverting to the_content(). Simplify functions.php, JS, and CSS files accordingly. Props obenland for starter patch, fixes #24469 and #24407. See #24452.

Location:
trunk/wp-content/themes/twentythirteen
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentythirteen/content-audio.php

    r24131 r24391  
    2020    </header><!-- .entry-header -->
    2121
    22     <div class="entry-media">
     22    <div class="entry-content">
    2323        <div class="audio-content">
    24             <?php the_post_format_audio(); ?>
     24            <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
     25            <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
    2526        </div><!-- .audio-content -->
    26     </div><!-- .entry-media -->
    27 
    28     <div class="entry-content">
    29         <?php the_remaining_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
    30         <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
    3127    </div><!-- .entry-content -->
    3228
  • trunk/wp-content/themes/twentythirteen/content-chat.php

    r24167 r24391  
    2121
    2222    <div class="entry-content">
    23         <?php the_post_format_chat(); ?>
     23        <?php the_content(); ?>
    2424        <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
    2525    </div><!-- .entry-content -->
  • trunk/wp-content/themes/twentythirteen/content-gallery.php

    r24331 r24391  
    2525            <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
    2626        <?php else : ?>
    27             <?php the_post_format_gallery(); ?>
     27            <?php echo get_post_gallery(); ?>
    2828        <?php endif; // is_single() ?>
    2929    </div><!-- .entry-content -->
  • trunk/wp-content/themes/twentythirteen/content-image.php

    r24131 r24391  
    1010
    1111<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    12     <div class="entry-media">
    13         <?php the_post_format_image( 'twentythirteen-image-post' ); ?>
    14     </div><!-- .entry-media -->
    15 
    1612    <header class="entry-header">
    1713        <?php if ( is_single() ) : ?>
     
    2521
    2622    <div class="entry-content">
    27         <?php the_remaining_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
     23        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
    2824        <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
    2925    </div><!-- .entry-content -->
  • trunk/wp-content/themes/twentythirteen/content-video.php

    r24131 r24391  
    1010
    1111<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    12     <div class="entry-media">
    13         <?php the_post_format_video(); ?>
    14     </div><!-- .entry-media -->
    15 
    1612    <header class="entry-header">
    1713        <?php if ( is_single() ) : ?>
     
    2521
    2622    <div class="entry-content">
    27         <?php the_remaining_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
     23        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
    2824        <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
    2925    </div><!-- .entry-content -->
  • trunk/wp-content/themes/twentythirteen/css/editor-style.css

    r24347 r24391  
    1515 * 6.0 - Tables
    1616 * 7.0 - Images
    17  * 8.0 - Post Formats
    18  * 9.0 - RTL
     17 * 8.0 - RTL
    1918 * ----------------------------------------------------------------------------
    2019 */
     
    366365}
    367366
    368 /**
    369  * 8.0 Post Formats
    370  * ----------------------------------------------------------------------------
    371  */
    372 
    373 /* Aside */
    374 .post-format-aside {
    375     background-color: #f7f5e7;
    376 }
    377 
    378 .post-format-aside blockquote {
    379     font-size: 100%;
    380     font-weight: normal;
    381 }
    382 
    383 .post-format-aside cite {
    384     font-size: 100%;
    385     text-transform: none;
    386 }
    387 
    388 .post-format-aside cite:before {
    389     content: "\2014";
    390     margin-right: 5px;
    391 }
    392 
    393 /* Audio */
    394 .post-format-audio {
    395     background-color: #db572f;
    396 }
    397 
    398 .post-format-audio a {
    399     color: #fbfaf3;
    400 }
    401 
    402 /* Chat */
    403 .post-format-chat {
    404     background-color: #eadaa6;
    405 }
    406 
    407 .post-format-chat a {
    408     color: #722d19;
    409 }
    410 
    411 /* Gallery */
    412 .post-format-gallery {
    413     background-color: #fbca3c;
    414 }
    415 
    416 .post-format-gallery a {
    417     color: #722d19;
    418 }
    419 
    420 /* Image: same as Standard/Defaults */
    421 
    422 /* Link */
    423 .post-format-link {
    424     background-color: #f7f5e7;
    425 }
    426 
    427 /* Quote */
    428 .post-format-quote {
    429     background-color: #210d10;
    430     color: #f7f5e7;
    431 }
    432 
    433 .post-format-quote blockquote {
    434     font-size: 28px;
    435     font-style: italic;
    436     font-weight: 300;
    437     margin: 0;
    438     padding-left: 75px;
    439     position: relative;
    440 }
    441 
    442 .post-format-quote blockquote:before {
    443     content: '\201C';
    444     font-size: 140px;
    445     font-weight: 400;
    446     line-height: .8;
    447     padding-right: 25px;
    448     position: absolute;
    449     left: -15px;
    450     top: -3px;
    451 }
    452 
    453 .post-format-quote a {
    454     color: #e63f2a;
    455 }
    456 
    457 .post-format-quote .quote-caption,
    458 .post-format-quote blockquote small,
    459 .post-format-quote blockquote cite {
    460     display: block;
    461     font-size: 16px;
    462 }
    463 
    464 /* Status */
    465 .post-format-status {
    466     background-color: #722d19;
    467     color: #f7f5e7;
    468     font-style: italic;
    469     font-weight: 300;
    470     padding: 0;
    471     padding-left: 35px;
    472 }
    473 
    474 .post-format-status.mceContentBody {
    475     font-size: 24px;
    476 }
    477 
    478 .post-format-status:before {
    479     background-size: 4px 4px;
    480     background: url(../images/dotted-line.png) repeat-y left bottom;
    481     content: "";
    482     display: block;
    483     height: 100%;
    484     position: absolute;
    485     left: 15px;
    486     top: 0;
    487     width: 1px;
    488 }
    489 
    490 .post-format-status p:first-child:before {
    491     background-color: rgba(0, 0, 0, 0.65);
    492     content: "";
    493     height: 3px;
    494     width: 13px;
    495     margin-top: 13px;
    496     position: absolute;
    497     left: 9px;
    498 }
    499 
    500 .post-format-status a {
    501     color: #eadaa6;
    502 }
    503 
    504 /* Video */
    505 .post-format-video {
    506     background-color: #db572f;
    507 }
    508 
    509 .post-format-video a {
    510     color: #fbfaf3;
    511 }
    512 
    513 
    514 /**
    515  * 9.0 RTL
     367
     368/**
     369 * 8.0 RTL
    516370 * ----------------------------------------------------------------------------
    517371 */
  • trunk/wp-content/themes/twentythirteen/css/ie.css

    r24239 r24391  
    1111.date a:before:hover,
    1212.entry-meta .author a:before:hover,
    13 .format-audio .entry-media:before:hover,
     13.format-audio .entry-content:before:hover,
    1414.comments-link a:before:hover,
    1515.tags-links a:first-child:before:hover,
     
    281281}
    282282
    283 .ie7 .format-quote .quote {
    284     padding: 0;
    285 }
    286 
    287283/* RTL for Internet Explorer 7 & 8 */
    288 .rtl .format-audio .entry-media:before,
     284.rtl .format-audio .entry-content:before,
    289285.rtl .comment-reply-link:before,
    290286.rtl .comment-reply-login:before {
  • trunk/wp-content/themes/twentythirteen/functions.php

    r24390 r24391  
    9595    add_theme_support( 'post-thumbnails' );
    9696    set_post_thumbnail_size( 604, 270, true );
    97 
    98     // Register custom image size for image post formats.
    99     add_image_size( 'twentythirteen-image-post', 724, 1288 );
    10097
    10198    // This theme uses its own gallery styles.
     
    437434 */
    438435function twentythirteen_get_link_url() {
    439     $has_url = get_the_post_format_url();
     436    $content = get_the_content();
     437    $has_url = get_content_url( $content );
    440438
    441439    return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
     
    493491 */
    494492function twentythirteen_content_width() {
    495     if ( has_post_format( 'video' ) || is_attachment() ) {
    496         global $content_width;
     493    global $content_width;
     494
     495    if ( is_attachment() )
    497496        $content_width = 724;
    498     }
     497    elseif ( has_post_format( 'audio' ) )
     498        $content_width = 484;
    499499}
    500500add_action( 'template_redirect', 'twentythirteen_content_width' );
    501 
    502 /**
    503  * Adjusts content_width value for video shortcodes in video post formats.
    504  *
    505  * @since Twenty Thirteen 1.0
    506  *
    507  * @param array $atts The attribute list.
    508  * @return array The filtered attribute list.
    509  */
    510 function twentythirteen_video_width( $atts ) {
    511     if ( ! is_admin() && has_post_format( 'video' ) ) {
    512         $new_width = 724;
    513         $atts['height'] = round( ( $atts['height'] * $new_width ) / $atts['width'] );
    514         $atts['width'] = $new_width;
    515     }
    516 
    517     return $atts;
    518 }
    519 add_action( 'embed_defaults',       'twentythirteen_video_width' );
    520 add_action( 'shortcode_atts_video', 'twentythirteen_video_width' );
    521501
    522502/**
  • trunk/wp-content/themes/twentythirteen/js/functions.js

    r24172 r24391  
    99        body               = $( 'body' ),
    1010        _window            = $( window ),
    11         captions           = $( '.quote-caption' ),
    1211        adjustFooter,
    1312
     
    7271    } );
    7372
    74     /** Better styles for Quote post formats with a linked source.
    75      *
    76      */
    77     if ( captions )
    78         captions.has( 'a' ).addClass( 'linked' );
    79 
    8073    /**
    8174     * Arranges footer widgets vertically.
  • trunk/wp-content/themes/twentythirteen/rtl.css

    r24239 r24391  
    152152 */
    153153
    154 .sidebar .entry-media {
    155     padding-left: 316px;
    156     padding-right: 0;
    157 }
    158 
    159154.sidebar .entry-header,
    160155.sidebar .entry-content,
     
    246241 */
    247242
    248 .entry-media a,
    249243.entry-content a {
    250244    display: inline;
     
    261255}
    262256
    263 .format-audio .entry-media:before {
     257.format-audio .entry-content:before {
    264258    float: right;
    265259    -webkit-transform: scaleX(-1);
     
    270264}
    271265
    272 .format-audio .entry-media,
    273 .sidebar .format-audio .entry-media {
    274     padding-left: 374px;
    275     padding-right: 60px;
    276 }
    277 
    278266.format-audio .audio-content {
    279267    background-position: right top;
     
    344332}
    345333
    346 .format-quote .quote {
     334.format-quote blockquote {
    347335    padding-left: 0;
    348336    padding-right: 75px;
    349337}
    350338
    351 .format-quote .quote:before {
     339.format-quote blockquote:before {
    352340    content: '\201D';
    353341    padding-left: 25px;
     
    609597
    610598@media (max-width: 1069px) {
    611     .sidebar .entry-media,
    612     .format-audio .entry-media,
    613     .sidebar .format-audio .entry-media {
    614         padding-left: 376px;
    615         padding-right: 60px;
    616     }
    617 
    618599    ul.nav-menu,
    619600    div.nav-menu > ul {
     
    657638    }
    658639
    659     .sidebar .entry-media,
    660     .format-audio .entry-media,
    661     .sidebar .format-audio .entry-media {
    662         padding-left: 0;
    663         padding-right: 0;
    664     }
    665 
    666640    .site-main .widget-area {
    667641        float: none;
  • trunk/wp-content/themes/twentythirteen/style.css

    r24389 r24391  
    258258
    259259blockquote cite,
    260 blockquote small,
    261 .quote-caption {
     260blockquote small {
    262261    font-size: 14px;
    263262    font-weight: normal;
     
    481480.date a:before,
    482481.entry-meta .author a:before,
    483 .format-audio .entry-media:before,
     482.format-audio .entry-content:before,
    484483.comments-link a:before,
    485484.tags-links a:first-child:before,
     
    503502/* Clearing floats */
    504503.clear:after,
    505 .entry-media:after,
    506504.attachment .entry-header:after,
    507505.site-footer .widget-area:after,
     
    517515.clear:before,
    518516.clear:after,
    519 .entry-media:before,
    520 .entry-media:after,
    521517.attachment .entry-header:before,
    522518.attachment .entry-header:after,
     
    677673}
    678674
    679 .entry-media img,
    680675img.size-full,
    681676img.size-large,
     
    11271122
    11281123.entry-content blockquote cite,
    1129 .entry-content blockquote small,
    1130 .entry-content .quote-caption {
     1124.entry-content blockquote small {
    11311125    font-size: 16px;
    11321126}
     
    13661360 */
    13671361
    1368 .entry-media {
    1369     margin: 0 auto 24px;
    1370     max-width: 724px;
    1371     width: 100%;
    1372 }
    1373 
    1374 .sidebar .entry-media {
    1375     max-width: 1040px;
    1376     padding: 0 316px 0 0;
    1377 }
    1378 
    1379 .entry-media .wp-caption,
    1380 .entry-media .wp-caption-text,
    1381 .entry-media [class*="align"] {
    1382     margin: 0 auto;
    1383 }
    1384 
    13851362/* Aside */
    13861363.format-aside {
     
    14251402}
    14261403
    1427 .format-audio .entry-media {
    1428     max-width: 604px;
    1429 }
    1430 
    1431 .sidebar .format-audio .entry-media {
    1432     max-width: 1040px;
    1433     padding: 0 374px 0 60px;
    1434 }
    1435 
    1436 .format-audio .entry-media:before {
     1404.format-audio .entry-content:before {
    14371405    content: "\f109";
    14381406    float: left;
     
    16831651}
    16841652
    1685 .format-quote .quote-caption,
    16861653.format-quote blockquote small,
    16871654.format-quote blockquote cite {
     
    16901657}
    16911658
    1692 .format-quote .quote {
     1659.format-quote blockquote {
    16931660    font-style: italic;
    16941661    font-weight: 300;
     
    16971664}
    16981665
    1699 .format-quote .quote:before {
     1666.format-quote blockquote:before {
    17001667    content: '\201C';
    17011668    font-size: 140px;
     
    27122679
    27132680@media (max-width: 1069px) {
    2714     .sidebar .entry-media {
    2715         padding: 0 376px 0 60px;
    2716     }
    2717 
    27182681    .sidebar img.alignleft,
    27192682    .sidebar .wp-caption.alignleft {
     
    27822745    .sidebar .featured-gallery,
    27832746    .sidebar .post-navigation .nav-links,
    2784     .author.sidebar .author-info,
    2785     .format-audio .entry-media,
    2786     .sidebar .format-audio .entry-media {
     2747    .author.sidebar .author-info {
    27872748        max-width: 604px;
    27882749        padding-left: 0;
     
    28022763    }
    28032764
    2804     .sidebar .entry-media {
    2805         max-width: 724px;
    2806     }
    2807 
    2808     .sidebar .entry-media,
    28092765    .sidebar .archive-meta,
    28102766    .attachment .entry-header,
     
    28872843    }
    28882844
    2889     .entry-media,
    2890     .sidebar .entry-media {
    2891         max-width: 604px;
    2892     }
    2893 
    28942845    .attachment .image-navigation,
    28952846    .attachment .entry-attachment .attachment {
     
    29092860    }
    29102861
    2911     #content .entry-media,
    29122862    #content .entry-header,
    29132863    #content .entry-content,
     
    30252975
    30262976    .format-quote blockquote small,
    3027     .format-quote blockquote cite,
    3028     .format-quote .quote-caption {
     2977    .format-quote blockquote cite {
    30292978        font-size: 13px;
    30302979    }
     
    30673016
    30683017    /* Audio */
     3018    .format-audio .entry-content:before {
     3019        display: none;
     3020    }
     3021
    30693022    .format-audio .audio-content {
    30703023        background-image: none;
     
    30723025        padding-left: 0;
    30733026        width: auto;
    3074     }
    3075 
    3076     .format-audio .entry-media:before {
    3077         display: none;
    30783027    }
    30793028}
Note: See TracChangeset for help on using the changeset viewer.