Tagged: image size, thumbnail
-
AuthorPosts
-
May 28, 2020 at 3:22 pm #1217387
Hi,
I’ve many website with enfold and all are the same problem too much space on ftp with diffrent image size.
I’ve found and read many post on forum here :and
https://kriesi.at/support/topic/how-can-i-delete-all-enfold-image-sizes/
are the best for me.
BUT :)
How to remove this image size in functions.php child ?
and just some size and not all the size.I’ve tested the plugin “Simple Image Sizes” but it doesn’t work for me…
I’m surprised than kriesi don’t found a user friendly solution for his problem, it will be good ! :)June 4, 2020 at 11:57 am #1219343Hey Luc,
Thank you for the inquiry.
How to remove this image size in functions.php child ?
You can move the provided filter from the previous thread in the child theme’s functions.php file. And if you want to retain other sizes, just look for these lines:
remove_image_size('magazine'); remove_image_size('portfolio_small');
The lines above disable the “magazine” and the “portfolio_small” thumbnail, so if you want to retain those thumbnails, you have to delete those lines.
Best regards,
IsmaelOctober 8, 2020 at 3:14 pm #1251447Hi Ismael, I come back to this post several weeks later :). How do I declare the function in the child theme?
there is a precise syntax for overlaying the native function I guess?- This reply was modified 4 years, 2 months ago by Luc.
October 9, 2020 at 1:47 pm #1251703Hi,
Thank you for the update.
We can use the syntax above in the child theme, or wrap it inside an action hook like init or after_setup_theme so that the code is actually executed after the functions.php file has been loaded.
add_action('after_setup_theme', function() { remove_image_size('magazine'); remove_image_size('portfolio_small'); }, 999);
Best regards,
IsmaelNovember 23, 2020 at 10:30 am #1262296Hi, thanks for this code, it’s perfectly what I need.
Now I’m looking for remove all older thumbnails not used. Do you have a solution ? I’have 19 thumbnail for each file since many years^^, the upload folder make more 1Go. Do you have a solution ?
I think the hardest part is identifying the images not used by WordPress …
thanks- This reply was modified 4 years ago by Luc.
November 25, 2020 at 5:14 am #1262893Hi,
Thank you for the update.
The unregistered thumbnails will be removed automatically when you regenerate the images. Please install one of the following plugins to regenerate the images. This process might take a while depending on the number of images uploaded in the media library.
// https://wordpress.org/plugins/regenerate-thumbnails/
// https://wordpress.org/plugins/simple-image-sizes/This process is safe but please do not forget to create a restore point or a site backup before regenerating the images in case something went wrong.
Best regards,
IsmaelNovember 25, 2020 at 5:16 am #1262894Hi,
Thank you for the update.
The unregistered thumbnails will be removed automatically when you regenerate the images using a plugin or a custom script, but we recommend installing an extension. This process might take a while depending on the number of images uploaded in the media library. Please check these plugins.
// https://wordpress.org/plugins/regenerate-thumbnails/
// https://wordpress.org/plugins/simple-image-sizes/This process is safe but please do not forget to create a restore point or a site backup before regenerating the images in case something went wrong.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.