voceconnect / multi-post-thumbnails

Adds multiple post thumbnails to a post type. If you've ever wanted more than one Featured Image on a post, this plugin is for you.
143 stars 63 forks source link

Get_the_post_thumbnail can't define the size of the image #132

Open IacopoC opened 6 years ago

IacopoC commented 6 years ago

Hello, I'm using this code inside a WP_Query loop, <?php echo MultiPostThumbnails::get_the_post_thumbnail('products','secondary-image'); ?> but even if I define a custom add_image_size in functions php, add_image_size('custom-thumbnail-size', 300, 300, true); I can't define a custom image size and the thumbnail remain 150px x 150px

I tried in this way: <?php echo MultiPostThumbnails::get_the_post_thumbnail('custom-thumbnail-size','products','secondary-image'); ?> Thanks for helping.

matgargano commented 6 years ago

If you upload an image before defining a thumbnail size there is no implicit process in WordPress that will retro crop images, you have to use a plugin to regenerate thumbnails.

See https://wordpress.org/plugins/regenerate-thumbnails/

On Oct 5, 2018, at 7:00 AM, Iacopo C notifications@github.com wrote:

Hello, I'm using this code inside a WP_Query loop, <?php echo MultiPostThumbnails::get_the_post_thumbnail('products','secondary-image'); ?> but even if I define a custom add_image_size in functions php, add_image_size('custom-thumbnail-size', 300, 300, true); I can't define a custom image size and the thumbnail remain 150px x 150px

I tried in this way: <?php echo MultiPostThumbnails::get_the_post_thumbnail('custom-thumbnail-size','products','secondary-image'); ?> Thanks for helping.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

IacopoC commented 6 years ago

Ok thank you I'll give it a try.