Make WordPress Core

Ticket #25946: 25946.1.diff

File 25946.1.diff, 2.7 KB (added by obenland, 12 years ago)

Simplify and prefix post thumbnail sizes.

  • content-featured-post.php

     
    1313        <?php
    1414                if ( has_post_thumbnail() ) :
    1515                        if ( 'grid' == get_theme_mod( 'featured_content_layout' ) )
    16                                 the_post_thumbnail( 'post-thumbnail' );
     16                                the_post_thumbnail();
    1717                        else
    18                                 the_post_thumbnail( 'post-thumbnail-full-width' );
     18                                the_post_thumbnail( 'twentyfourteen-full-width' );
    1919                endif;
    2020        ?>
    2121        </a>
  • functions.php

     
    6666
    6767        // Enable support for Post Thumbnails, and declare two sizes.
    6868        add_theme_support( 'post-thumbnails' );
    69         add_image_size( 'post-thumbnail-full-width', 1038, 576, true );
    70         add_image_size( 'post-thumbnail', 672, 372, true );
     69        set_post_thumbnail_size( 672, 372, true );
     70        add_image_size( 'twentyfourteen-full-width', 1038, 576, true );
    7171
    7272        // This theme uses wp_nav_menu() in two locations.
    7373        register_nav_menus( array(
  • inc/template-tags.php

     
    174174        <div class="post-thumbnail">
    175175        <?php
    176176                if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) && ! wp_is_mobile() )
    177                         the_post_thumbnail( 'post-thumbnail-full-width' );
     177                        the_post_thumbnail( 'twentyfourteen-full-width' );
    178178                else
    179                         the_post_thumbnail( 'post-thumbnail' );
     179                        the_post_thumbnail();
    180180        ?>
    181181        </div>
    182182
     
    185185        <a class="post-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">
    186186        <?php
    187187                if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) && ! wp_is_mobile() )
    188                         the_post_thumbnail( 'post-thumbnail-full-width' );
     188                        the_post_thumbnail( 'twentyfourteen-full-width' );
    189189                else
    190                         the_post_thumbnail( 'post-thumbnail' );
     190                        the_post_thumbnail();
    191191        ?>
    192192        </a>
    193193
  • inc/widgets.php

     
    158158                                                                        $total_images = count( $images );
    159159
    160160                                                                        if ( has_post_thumbnail() ) :
    161                                                                                 $post_thumbnail = get_the_post_thumbnail( get_the_ID(), 'post-thumbnail' );
     161                                                                                $post_thumbnail = get_the_post_thumbnail();
    162162                                                                        elseif ( $total_images > 0 ) :
    163163                                                                                $image          = array_shift( $images );
    164164                                                                                $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' );