Entry Featured Thumbnail Size

How can I change the thumbnail size of the entry-featured image on blog posts? I just want to change it to my current medium thumbnail size so I don’t have to regen thumbnails. Also, I think there used to be a hook to enable the wordpress responsive image srcset support that you disabled. How can I do this? Thanks.

Hi There,

Please provide your URL and a mockup of how you would like it.

Thank you

The url is https://www.ryansmithphotography.com, but again I just want to change the thumbnail size for the blog posts entry-featured image. I found the filter to enable the responsive images again.

function x_disable_wp_image_srcset( $source ) {
  return true;
}

Hello There,

Thanks for updating in!

To change the size of the featured image in your blog index and archive pages, please add the following code in your child theme’s functions.php file

if ( ! function_exists( 'x_featured_image' ) ) :
  function x_featured_image( $cropped = '' ) {

    $stack     = x_get_stack();
    $fullwidth = ( in_array( 'x-full-width-active', get_body_class() ) ) ? true : false;

    if ( has_post_thumbnail() ) {

      if ( $cropped == 'cropped' ) {
        if ( $fullwidth ) {
          $thumb = get_the_post_thumbnail( NULL, 'entry-cropped-fullwidth', NULL );
        } else {
          $thumb = get_the_post_thumbnail( NULL, 'entry-cropped', NULL );
        }
      } else {
        if ( $fullwidth ) {
          $thumb = get_the_post_thumbnail( NULL, 'entry-fullwidth', NULL );
        } else {
          $thumb = get_the_post_thumbnail( NULL, 'entry', NULL );
        }
      }

      switch ( is_singular() ) {
        case true:
          printf( '<div class="entry-thumb">%s</div>', $thumb );
          break;
        case false:
          $thumb = get_the_post_thumbnail( NULL, 'medium', NULL );
          printf( '<a href="%1$s" class="entry-thumb" title="%2$s">%3$s</a>',
            esc_url( get_permalink() ),
            esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ),
            $thumb
          );
          break;
      }

    }

  }
endif;

if ( ! function_exists( 'x_disable_wp_image_srcset' ) ) :
  function x_disable_wp_image_srcset( $source ) {
    return true;
  }
  add_filter( 'wp_calculate_image_srcset', 'x_disable_wp_image_srcset' );
endif;

You can change the image size from thumbnail, medium, large. In the code I used medium as the default image size for the blog index and archive pages.

Hope this helps. Kindly let us know.

Hi, I have similar problems for Woocommerce product index. The product images while shown as thumbnails, they are actually full size images shrunk into smaller size.

See here: https://aaxsf.com/shop/

Please help. Thanks.

Hey @johnm,

Thanks for writing around! Please update your theme and plugins to the latest version as we’ve addressed the thumbnails issue in the latest version. After the update you may need to regenerate your thumbnails if your images are not appearing at the correct size. Under WooCommerce settings, you will now see the native thumbnail dimension options that we were removing in previous versions. For the details please see the changelog https://theme.co/changelog/#theme-x-5-1-1

Hope this helps!

Great thanks! I probably didn’t specify clearly I wanted a different entry thumbnail size on my blog posts as well as archive. So I guess if is_singular is true as well I want to change the entry-thumb size. Thanks!

You’re welcome!
Thanks for letting us know that it has worked for you.

Yes it mostly worked but like I mentioned I wanted the different size thumbnails on the archives as well as singular blog posts. How can I modify what you gave me to change the size for singular posts and archives? Thanks.

Hello There,

You can modify the switch section to display the large image size for the single post;

   switch ( is_singular() ) {
        case true:
          $thumb = get_the_post_thumbnail( NULL, 'large', NULL );
          printf( '<div class="entry-thumb">%s</div>', $thumb );
          break;
        case false:
          $thumb = get_the_post_thumbnail( NULL, 'medium', NULL );
          printf( '<a href="%1$s" class="entry-thumb" title="%2$s">%3$s</a>',
            esc_url( get_permalink() ),
            esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ),
            $thumb
          );
          break;
      }

Or have something like this:

if ( ! function_exists( 'x_featured_image' ) ) :
  function x_featured_image( $cropped = '' ) {

    $stack     = x_get_stack();
    $fullwidth = ( in_array( 'x-full-width-active', get_body_class() ) ) ? true : false;

    if ( has_post_thumbnail() ) {

      if ( $cropped == 'cropped' ) {
        if ( $fullwidth ) {
          $thumb = get_the_post_thumbnail( NULL, 'entry-cropped-fullwidth', NULL );
        } else {
          $thumb = get_the_post_thumbnail( NULL, 'entry-cropped', NULL );
        }
      } else {
        if ( $fullwidth ) {
          $thumb = get_the_post_thumbnail( NULL, 'entry-fullwidth', NULL );
        } else {
          $thumb = get_the_post_thumbnail( NULL, 'entry', NULL );
        }
      }

      if ( is_archive() ) {
      	$thumb = get_the_post_thumbnail( NULL, 'medium', NULL );
      } elseif ( is_single() ) {
      	$thumb = get_the_post_thumbnail( NULL, 'large', NULL );
      } else {
      	// let the default value
      }

      switch ( is_singular() ) {
        case true:
          printf( '<div class="entry-thumb">%s</div>', $thumb );
          break;
        case false:
          printf( '<a href="%1$s" class="entry-thumb" title="%2$s">%3$s</a>',
            esc_url( get_permalink() ),
            esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ),
            $thumb
          );
          break;
      }

    }

  }
endif;

if ( ! function_exists( 'x_disable_wp_image_srcset' ) ) :
  function x_disable_wp_image_srcset( $source ) {
    return true;
  }
  add_filter( 'wp_calculate_image_srcset', 'x_disable_wp_image_srcset' );
endif;

We would loved to know if this has work for you. Thank you.

That worked perfectly, thanks!

Glad we could help.

Cheers!