Make WordPress Core

Changeset 23839


Ignore:
Timestamp:
03/28/2013 07:02:51 AM (11 years ago)
Author:
lancewillett
Message:

Twenty Thirteen: improvements to Image post format handling to use a custom image size instead of filtering a $content_width variable.

Includes CSS cleanup and markup improvements to both video and image templates, moving the media HTML piece out of the header element.

Props obenland, closes #23620.

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

Legend:

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

    r23836 r23839  
    1010
    1111<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     12    <div class="entry-media">
     13        <?php the_image( 'twentythirteen-image-post-format' ); ?>
     14    </div><!-- .entry-media -->
     15
    1216    <header class="entry-header">
    13         <div class="entry-media">
    14             <?php the_image(); ?>
    15         </div>
    16 
    1717        <?php if ( is_single() ) : ?>
    1818        <h1 class="entry-title"><?php the_title(); ?></h1>
  • trunk/wp-content/themes/twentythirteen/content-video.php

    r23836 r23839  
    1010
    1111<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     12    <div class="entry-media">
     13        <?php the_video(); ?>
     14    </div><!-- .entry-media -->
     15
    1216    <header class="entry-header">
    13         <div class="entry-media">
    14             <?php the_video(); ?>
    15         </div>
    16 
    1717        <?php if ( is_single() ) : ?>
    1818        <h1 class="entry-title"><?php the_title(); ?></h1>
  • trunk/wp-content/themes/twentythirteen/functions.php

    r23837 r23839  
    100100    add_theme_support( 'post-thumbnails' );
    101101    set_post_thumbnail_size( 604, 270, true );
     102
     103    // Register custom image size for image post formats.
     104    add_image_size( 'twentythirteen-image-post-format', 724, 1288 );
    102105
    103106    // This theme uses its own gallery styles.
     
    528531 */
    529532function twentythirteen_content_width() {
    530     if ( has_post_format( 'image' ) || has_post_format( 'video' ) || is_attachment() ) {
     533    if ( has_post_format( 'video' ) || is_attachment() ) {
    531534        global $content_width;
    532535        $content_width = 724;
  • trunk/wp-content/themes/twentythirteen/style.css

    r23835 r23839  
    14101410 */
    14111411
     1412.entry-media {
     1413    margin: 0 auto 24px;
     1414    max-width: 724px;
     1415    width: 100%;
     1416}
     1417
     1418.sidebar .entry-media {
     1419    max-width: 1040px;
     1420    padding: 0 316px 0 0;
     1421}
     1422.entry-media > * {
     1423    display: block;
     1424    margin: 0 auto;
     1425    max-width: 100%;
     1426}
     1427
    14121428/* Aside */
    14131429.format-aside {
     
    14711487
    14721488.format-audio .entry-media {
    1473     margin: 0 auto 24px;
    14741489    max-width: 604px;
    1475     width: 100%;
    14761490}
    14771491
     
    16591673    font-size: 28px;
    16601674    font-weight: bold;
    1661 }
    1662 
    1663 .format-image .entry-header {
    1664     max-width: 724px;
    1665 }
    1666 
    1667 .format-image .entry-header img {
    1668     height: auto;
    1669     max-width: 724px;
    1670 }
    1671 
    1672 .format-image .entry-content .size-full {
    1673     margin: 0 -60px;
    1674     max-width: 724px;
    1675 }
    1676 
    1677 .format-image .wp-caption {
    1678     margin: 0 auto;
    1679     text-align: center;
    1680 }
    1681 
    1682 .format-image .wp-caption-text {
    1683     padding: 0 5px;
    1684     text-align: left;
    1685 }
    1686 
    1687 .format-image .wp-caption.alignleft:first-of-type,
    1688 .format-image .wp-caption.alignright:first-of-type {
    1689     margin: 0;
    1690 }
    1691 
    1692 .format-image p:last-child {
    1693     margin: 0;
    16941675}
    16951676
     
    18621843
    18631844.format-video .entry-content a,
    1864 .single-format-video .entry-content a,
    1865 .format-video .entry-meta a {
    1866     color: #fbfaf3;
    1867 }
    1868 
     1845.format-video .entry-meta a,
    18691846.format-video .entry-content a:hover,
    18701847.format-video .entry-meta a:hover {
    1871     color: #ea9629;
     1848    color: #fbfaf3;
    18721849}
    18731850
     
    18751852    font-size: 50px;
    18761853    font-weight: 400;
    1877 }
    1878 
    1879 .format-video .entry-header {
    1880     max-width: 724px;
    18811854}
    18821855
Note: See TracChangeset for help on using the changeset viewer.