Last active
December 22, 2018 08:41
-
-
Save stefanledin/8aa971089c5361d4a568ddcc50070fbb to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* Custom image sizes | |
*/ | |
add_image_size('my-custom-image-size', 768, null, false); | |
add_filter( 'image_size_names_choose', function( $sizes ) { | |
// Remove build in sizes | |
unset($sizes['thumbnail']); | |
unset($sizes['medium']); | |
unset($sizes['large']); | |
// Add the custom image size | |
$sizes['my-custom-image-size'] = 'My Custom Image Size'; | |
return $sizes; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment