Make WordPress Core

Ticket #25581: 25581.1.diff

File 25581.1.diff, 3.9 KB (added by iamtakashi, 11 years ago)
  • wp-content/themes/twentyfourteen/content-featured-post.php

     
    2727                                if ( $images ) :
    2828                                        $image = array_shift( $images );
    2929                                        echo wp_get_attachment_image( $image->ID, 'featured-thumbnail-featured' );
    30 
    31                                 else : ?>
    32                                         <img class="featured-thumbnail-featured" src="<?php echo get_template_directory_uri(); ?>/images/placeholder.png" alt="" /><?php
    33 
    3430                                endif;
    3531                        endif;
    3632                ?>
     
    4642
    4743                        <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
    4844                </header><!-- .entry-header -->
    49 
    50                 <div class="entry-summary">
    51                         <?php the_excerpt(); ?>
    52                 </div><!-- .entry-summary -->
    5345        </div>
    5446</article><!-- #post-## -->
  • wp-content/themes/twentyfourteen/functions.php

     
    6969
    7070        // Add several sizes for Post Thumbnails.
    7171        add_image_size( 'featured-thumbnail-large', 672, 0 );
    72         add_image_size( 'featured-thumbnail-featured', 672, 336, true );
     72        add_image_size( 'featured-thumbnail-featured', 672, 372, true );
    7373        add_image_size( 'featured-thumbnail-formatted', 306, 0 );
    7474
    7575        // This theme uses wp_nav_menu() in two locations.
     
    253253}
    254254add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts' );
    255255
    256 /**
    257  * Set the post excerpt length to 20 words.
    258  *
    259  * @since Twenty Fourteen 1.0
    260  *
    261  * @param int $length
    262  * @return int
    263  */
    264 function twentyfourteen_excerpt_length( $length ) {
    265         return 20;
    266 }
    267 add_filter( 'excerpt_length', 'twentyfourteen_excerpt_length' );
    268 
    269 /**
    270  * Return a "Continue Reading" link for excerpts.
    271  *
    272  * @since Twenty Fourteen 1.0
    273  *
    274  * @return string
    275  */
    276 function twentyfourteen_continue_reading_link() {
    277         return ' <a href="'. esc_url( get_permalink() ) . '" class="more-link">' . __( 'Read More <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) . '</a>';
    278 }
    279 
    280 /**
    281  * Replace "[...]" (appended to automatically generated excerpts) with an
    282  * ellipsis and twentyeleven_continue_reading_link().
    283  *
    284  * @since Twenty Fourteen 1.0
    285  *
    286  * @param string $more
    287  * @return string
    288  */
    289 function twentyfourteen_auto_excerpt_more( $more ) {
    290         return ' &hellip;' . twentyfourteen_continue_reading_link();
    291 }
    292 add_filter( 'excerpt_more', 'twentyfourteen_auto_excerpt_more' );
    293 
    294 /**
    295  * Add a pretty "Continue Reading" link to custom post excerpts.
    296  *
    297  * To override this link in a child theme, remove the filter and add your own
    298  * function tied to the get_the_excerpt filter hook.
    299  *
    300  * @since Twenty Fourteen 1.0
    301  *
    302  * @param string $output
    303  * @return string
    304  */
    305 function twentyfourteen_custom_excerpt_more( $output ) {
    306         if ( has_excerpt() && ! is_attachment() ) {
    307                 $output .= twentyfourteen_continue_reading_link();
    308         }
    309         return $output;
    310 }
    311 add_filter( 'get_the_excerpt', 'twentyfourteen_custom_excerpt_more' );
    312 
    313256if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) :
    314257/**
    315258 * Print the attached image with a link to the next attached image.
  • wp-content/themes/twentyfourteen/style.css

    Cannot display: file marked as a binary type.
    svn:mime-type = image/png
     
    30063006                margin-left: 60px;
    30073007        }
    30083008
     3009        .featured-content {
     3010                margin-bottom: -24px;
     3011        }
     3012
    30093013        .attachment-featured-featured {
    30103014                height: 192px;
    30113015        }