WordPress.org

Make WordPress Core

Ticket #39281: 39281.diff

File 39281.diff, 1.7 KB (added by JPry, 3 years ago)
  • src/wp-content/themes/twentyseventeen/functions.php

    diff --git src/wp-content/themes/twentyseventeen/functions.php src/wp-content/themes/twentyseventeen/functions.php
    index a41d317e4..c7902dbcb 100644
    function twentyseventeen_front_page_template( $template ) { 
    502502add_filter( 'frontpage_template',  'twentyseventeen_front_page_template' );
    503503
    504504/**
     505 * Whether the featured image should be shown.
     506 *
     507 * @since Twenty Seventeen 1.1
     508 *
     509 * @return bool Whether the post thumbnail should be shown.
     510 */
     511function twentyseventeen_should_show_featured_image() {
     512        $show = has_post_thumbnail() && ( is_single() || ( is_page() && ! twentyseventeen_is_frontpage() ) );
     513
     514        /**
     515         * Filter whether the featured image should be shown.
     516         *
     517         * @param bool $show Whether to show the featured image.
     518         */
     519        return apply_filters( 'twentyseventeen_should_show_featured_image', $show );
     520}
     521
     522/**
    505523 * Implement the Custom Header feature.
    506524 */
    507525require get_parent_theme_file_path( '/inc/custom-header.php' );
  • src/wp-content/themes/twentyseventeen/header.php

    diff --git src/wp-content/themes/twentyseventeen/header.php src/wp-content/themes/twentyseventeen/header.php
    index 30d7d2a7c..ba989feec 100644
     
    4242
    4343        <?php
    4444        // If a regular post or page, and not the front page, show the featured image.
    45         if ( has_post_thumbnail() && ( is_single() || ( is_page() && ! twentyseventeen_is_frontpage() ) ) ) :
     45        if ( twentyseventeen_should_show_featured_image() ) :
    4646                echo '<div class="single-featured-image-header">';
    4747                the_post_thumbnail( 'twentyseventeen-featured-image' );
    4848                echo '</div><!-- .single-featured-image-header -->';