1
When inserting a post I can select some images to include, such as featured image, images in the body of the post and also by fields created by plugins (e.g., Advanced Custom Fields). These images can be resized with the function add_image_size
in the archive functions.php
of the theme, for example.
However, how can I add different and certain (plural) sizes to the featured image, to page body images and to the images of these new created fields?
I’m not sure I understand. The name you gave in
add_image_size
does not serve for you to reference the size?– Ricardo Moraleida
Exact, but I need to generate 3 sizes for the featured image, 4 for the body images and 2 for those inserted by the plugin. When using this function, it would generate 9 images, in addition to the already standardized ones for each added image
– Guilherme Pichok
What you want is to generate the sizes only when they are used in specific fields?
– Ricardo Moraleida
This, so that unnecessary images are not generated
– Guilherme Pichok
As far as I know this is not possible on the server-side without a bit of a headache. Maybe Photon will solve you: https://jetpack.com/support/photon/
– Ricardo Moraleida