Pro Featured image being resized?

Hello!

Hopefully you can provide some clarity here. I’ve got an image that was uploaded at 1500x1000 and set as the featured image on a blog post. However, upon publishing or previewing the draft post it appears that the image has been resized down to 862x575 as verified by the new url for the image. I’ve verified that there are no image optimization plugins causing this, so it appears that the theme itself has changed the image size.

I have seen other posts explaining all the complicated functions that take place behind the scenes to correctly size images - is it possible that this is what caused this? I just want to retain the original resolution (the newly resized image lost resolution and is now fuzzy) on the featured image. I’ve also verified that the other images in the post are still their intact and original resolution/size, so it’s limited to just the featured image.

Hopefully you can help me out! Thanks for any guidance you might have!

Hi,

I checked and the image is not being resize, it is still 1500x1000 in size but being displayed as 862x575 because your content width is 840px.

You can check your image url so you can verify your image size.

https://spacetourismguide.com/wp-content/uploads/2017/01/2019-Space-Tourism-Predictions-Eddie-Yip-via-Flickr-1.jpg

For more information kindly refer to the link below

https://www.w3schools.com/html/html_images.asp

Thanks

Hi Paul, Thanks for getting back to me. The strange thing is that this isn’t affecting posts that were published before I switched themes. Anything that was published before Feb 17th is as you mentioned and is the correct resolution. However, if you look at unpublished drafts, images are as I described. If you check the image url for this post which just went live today: https://spacetourismguide.com/wp-content/uploads/2019/02/Night-Sky-in-March-Hannah-Schwalbe-for-NPS-via-Flickr-862x575.jpg
then you’ll see that it’s been resized from it’s original 1500x1000 as I mentioned in the original post above. Since it didn’t happen on the old theme, it must be something with Pro, but I can’t figure out where…

Hello @whitisj,

Pro theme and the X theme will resize the featured image which will fit according to the site width you have set in the global settings. Do you want to override this settings and would like to display the full featured image instead? If that is the case, we would highly to suggest that you use a child theme. This is what you are trying to accomplish requires a template customization. The child theme allows you to make code changes that won’t be overwritten when an X update is released.

After the child theme is set up, please add the following code in your child theme’s functions.php file

// Full Featured Image
// =============================================================================

//
// Output featured image in an <a> tag on index pages and a <div> for single
// posts and pages.
//

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() ) {

      $thumb = get_the_post_thumbnail( NULL, 'full', NULL );

      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;

This code will make sure that the full featured image will be displayed and not the cropped version.

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

1 Like

Ok, thank you! I’ll give that a try this week and let you know how it works.

Let us know how it goes,

Thanks,

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.