0

I'm using a post thumbnail size and I was wondering if there is a way to setup so wordpress only make the thumbnail size when the image I upload is used as the featured image rather than for every image on the site.

// add Thumbnail option
add_theme_support('post-thumbnails', array('post', 'svg'));
set_post_thumbnail_size(275, 154, true);
2
  • I am not sure if this is possible as WP creates different sizes of the images on uploading it through the media uploader. Using/not using it as a featured image comes pretty much after that Commented Nov 25, 2013 at 7:26
  • There is an accepted answer to a similar question here: https://wordpress.stackexchange.com/a/57374/92868
    – Dvaeer
    Commented May 8, 2020 at 6:38

1 Answer 1

0

There is such plugin: Dynamic Image Resizer so you could give it a try. But... it's old, not maintained since 2012-04-30 so I'm not sure if it still works.

Normally when you upload an image to a WordPress site, it creates several differently sized versions of the image automatically. Themes can define custom image sizes as well, increasing the amount of images generated on your server.

This plugin changes the way WordPress creates images to make it generate the images only when they are actually used somewhere, on the fly. Images created thusly will be saved in the normal upload directories, for later fast sending by the webserver. The result is that space is saved (since images are only created when needed), and uploading images is much faster (since it's not generating the images on upload anymore).

"Pretty" permalinks must be enabled for this plugin to function.

Note: This plugin does not work on multisite setups, due to the way WordPress handles file serving in such situations (with ms-files.php).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.