Make WordPress Core


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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.