Created
February 8, 2022 16:07
-
-
Save Jehu/249656f6afcfc2d3154b8ddf92775887 to your computer and use it in GitHub Desktop.
WordPress - Additional Image Sizes
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_theme_support( 'post-thumbnails' ); | |
add_image_size( 'image-480', 480, 0 ); | |
add_image_size( 'image-640', 640, 0 ); | |
add_image_size( 'image-720', 720, 0 ); | |
add_image_size( 'image-960', 960, 0 ); | |
add_image_size( 'image-1168', 1168, 0 ); | |
add_image_size( 'image-1440', 1440, 0 ); | |
add_image_size( 'image-1920', 1920, 0 ); | |
function mwe_custom_sizes( $sizes ) { | |
return array_merge( $sizes, array( | |
'image-480' => 'image-480', | |
'image-640' => 'image-640', | |
'image-720' => 'image-720', | |
'image-960' => 'image-960', | |
'image-1168' => 'image-1168', | |
'image-1440' => 'image-1440', | |
'image-1920' => 'image-1920', | |
) ); | |
} | |
add_filter( 'image_size_names_choose', 'mwe_custom_sizes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment