admin管理员组

文章数量:1122846

Below is the code i used to set my thumbnail sizes. The Only problem I'm having is that my thumbnails won't resize to fit the size below or the <div>

add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 760, 330, true ); // Normal post thumbnails

Some images may be small but shouldn't they stretch themselves to proportion to fit the thumbnail size specified in the code above. Can any one tell me hop i can accomplish this. I have also tried adding a thumbnail size and calling it and it still didn't work.

I have also used the 'Thumbnail Regenerator' plugin to regenerate size, but they still don't fit. Why is this.

Here is an example below, notice that the second thumbnail doesn't fit.

Below is the code i used to set my thumbnail sizes. The Only problem I'm having is that my thumbnails won't resize to fit the size below or the <div>

add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 760, 330, true ); // Normal post thumbnails

Some images may be small but shouldn't they stretch themselves to proportion to fit the thumbnail size specified in the code above. Can any one tell me hop i can accomplish this. I have also tried adding a thumbnail size and calling it and it still didn't work.

I have also used the 'Thumbnail Regenerator' plugin to regenerate size, but they still don't fit. Why is this.

Here is an example below, notice that the second thumbnail doesn't fit.

Share Improve this question asked Oct 17, 2014 at 20:14 user32447user32447 8351 gold badge12 silver badges16 bronze badges 1
  • "Some images may be small but shouldn't they stretch themselves to proportion to fit the thumbnail size specified in the code above." ... if they are smaller then the content, then they won't get upscaled (and if, then only with a decent loss of quality). – kaiser Commented Oct 18, 2014 at 1:43
Add a comment  | 

1 Answer 1

Reset to default 0

change true to false in set_post_thumbnail_size( 760, 330, true )

add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 760, 330, false );

This will make it not crop automatically.

本文标签: Post thumbnail won39t resize to fit