Add Custom Image Sizes
Overview
Register custom proportional image sizes and expose them in the WordPress Media Library size selector.
The default widths are 480, 768, 960, and 1440. Each size is registered as mac_image_{width}, for example mac_image_480, with a proportional height and no hard crop.
Change the shared width list in the snippet when a theme needs different generated sizes. Existing uploads are not regenerated automatically; run a thumbnail regeneration tool after changing image size definitions on an existing site.
Variants
- Procedural
- OOP