Subscribe by email featured image size

Hi,

I'm trying to change the featured image size in the email template.

The theme uses blog post featured images at 650 x 275px and they look terrible when cropped to the default 150 x 150px.

I've tried editing post.php without success. Please let me know how to achieve this (a featured image in the email with the same proportions as the post's featured image).

Thanks.

Ken

  • Rupok

    Hi Ken,

    I've tried editing post.php without success

    Can you please let us know what modification did you try? I think you were close but don't know what you have missed. I could tell you better if you told us what code did you try.

    But it can be done. At first you have to create a custom image size so your image doesn't hard crop. You can do that by following this article: http://www.wpbeginner.com/wp-tutorials/how-to-create-additional-image-sizes-in-wordpress/

    In my test site, I've added the following line:
    add_image_size( 'email-thumb', 150, 9999 ); // Unlimited Height Mode
    Under this line:
    add_theme_support( 'post-thumbnails' );
    So my current code looks like this:

    Now open the post.php file inside "/wp-content/plugins/subscribe-by-email/inc/mail-templates/views/" folder and edit line: 7
    Change the following line:
    <?php sbe_mail_template_the_post_thumbnail( 'thumbnail' ); ?>
    With this line:
    <?php sbe_mail_template_the_post_thumbnail( 'email-thumb' ); ?>

    Again, open "abstract-class-sbe-template.php" file from "/wp-content/plugins/subscribe-by-email/inc/mail-templates/classes/" folder and edit line: 510
    From:
    function sbe_mail_template_the_post_thumbnail( $size = 'thumbnail' ) {
    To:
    function sbe_mail_template_the_post_thumbnail( $size = 'email-thumb' ) {

    And line: 515
    From:
    ?><div style="background:#DEDEDE !important;width:150px;height:100px;box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);float:left;border:1px solid #DEDEDE;padding:4px;margin:0 10px 10px 0;"></div><?php
    To:
    ?><div style="background:#DEDEDE !important;width:150px;box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);float:left;border:1px solid #DEDEDE;padding:4px;margin:0 10px 10px 0;"></div><?php

    And save.

    Now it should show a proportionally smaller image instead of 150X150 thumbnail.

    Please let us know if it doesn't work. We will be glad to assist further.

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.