How to add an image size to certain type of media in wordpress?

Asked

Viewed 38 times

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?

  • 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

  • What you want is to generate the sizes only when they are used in specific fields?

  • This, so that unnecessary images are not generated

  • 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/

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.