Okay
  Public Ticket #1179733
Thumbnail Size
Closed

Comments

  • Jonathan started the conversation

    Is there a way to change the thumbnail to fit a more 21:9 style resolution? The images I upload ate 1920x1080 so when they get scaled down for a thumbnail and its a perfect square alot gets cut off.

  •  521
    Nikita replied

    Hi, Jonathan.

    You can add customization for the function youplay_post_thumbnail in child theme.

    Original function code:

    if ( ! function_exists( 'youplay_post_thumbnail' ) ) :
    /**
     * Prints HTML with image and post url
     */
    function youplay_post_thumbnail( $get = false, $additional_info = '' ) {
        $template =
            '<a href="%s" class="angled-img">
                <div class="img">
                    %s
                </div>
                ' . $additional_info . '
            </a>';
        if ( has_post_thumbnail() ) {
            $thumbnail = get_the_post_thumbnail( get_the_ID(), '500x375' );
        } else {
            $thumbnail = '<img src="' . esc_url(yp_opts('single_post_noimage')) . '" alt="no image">';
        }
        if($get) {
            return sprintf( $template, esc_url( get_permalink() ), $thumbnail );
        } else {
            printf( $template, esc_url( get_permalink() ), $thumbnail );
        }
    }
    endif;
    

    You can activate child theme and insert this function in functions.php file. Then you will be able to change thumbnail size. See this part of code:

    $thumbnail = get_the_post_thumbnail( get_the_ID(), '500x375' );

    In the next update will be added possibility to change image resolution in theme options.

    Best regards, nK.