-
AuthorPosts
-
January 18, 2018 at 6:15 pm #899230
I have this code in my child theme functions.php file:
function ava_image_sizes() { remove_image_size('widget'); remove_image_size('featured'); remove_image_size('featured_large'); remove_image_size('extra_large'); remove_image_size('gallery'); remove_image_size('portfolio'); remove_image_size('magazine'); remove_image_size('masonry'); remove_image_size('shop_thumbnail'); remove_image_size('shop_catalog'); remove_image_size('shop_single'); } add_action( 'after_setup_theme', 'ava_image_sizes', 11 );
But when I upload a new image sized 700 x 467 px, the widget (36 x 36 px) and portfolio (495 x 400 px) images are still being created. Why, and how can I stop this happening?
January 18, 2018 at 6:43 pm #899246Hey zimbo,
You many need to regenerate thumbnails using – https://wordpress.org/plugins/regenerate-thumbnails/
Best regards,
Jordan ShannonJanuary 18, 2018 at 7:29 pm #899262Sorry, my title is not worded very well and is confusing.
I don’t want to remove the existing widget and portfolio images from the database.
remove_image_size should stop the specified image sizes from being created when a new image is uploaded. The function does do this for all the other image sizes specified, i.e. shop_thumbnail is not created.
But the widget and portfolio sizes are still being created when the function should stop this, but it’s not working.
January 23, 2018 at 4:32 am #901127Hi,
But when I upload a new image sized 700 x 467 px, the widget (36 x 36 px) and portfolio (495 x 400 px) images are still being created. Why, and how can I stop this happening?
Those are probably generated because the default thumbnails are still active. Please go to the Settings > Media panel. Set the thumbnail, medium and large thumbnail sizes to zero.
Best regards,
IsmaelJanuary 23, 2018 at 7:58 pm #901643All that zero setting does is to stop the default WP thumbnails being created.
It appears there’s a slight conflict / confusion with using functions.php with remove_image_size and the plugin Simple Image Sizes.
I use that plugin to alter the default Enfold sizes for a couple of images. When it’s active, the remove_image_size instructions are ignored and the images are still created.
If I deactivate the plugin then the function instructions work, and the specified images are not created – but then I have no ability to alter the Enfold image sizes to what I want.
The plugin allows me to ‘delete’ each image size, such as entry_with_sidebar. But if I delete the sizes I don’t want, Enfold just adds them back in when I try to save the new settings.
To get the desired result, you need the necessary remove_image_size instructions in functions.php and then via the plugin, go and delete the sizes not needed in Settings > Media, then save – and they now stay deleted, and are not created on a new upload.
Case closed. I hope… :-)
January 23, 2018 at 9:21 pm #901661Hi,
Great! I’m glad you were able to zero in a on solution. I will leave this thread open for a bit just in case the issue resurfaces.
Best regards,
Jordan Shannon -
AuthorPosts
- You must be logged in to reply to this topic.