Created
October 10, 2025 21:58
-
-
Save joshuafredrickson/e49ade190219bcbb1d73cd20a0aa97e1 to your computer and use it in GitHub Desktop.
Add additional images sizes to WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Add image sizes | |
| */ | |
| add_action('after_setup_theme', function (): void { | |
| $imageSizeColumnsAll = [3, 6, 9, 12, 18, 24]; | |
| $biggestImageSize = 1600; | |
| foreach ($imageSizeColumnsAll as $column) { | |
| add_image_size($column . '/12', ($column / 12) * $biggestImageSize); | |
| } | |
| }, 20); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment