Created
February 18, 2015 10:28
-
-
Save DigitalEssence/faf84e2ee33a4939e545 to your computer and use it in GitHub Desktop.
Wordpress - Add Custom Image Size to Admin Area
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
////////////////////////////////// | |
// Add new image size to WordPress | |
////////////////////////////////// | |
add_image_size( 'catalog', 490, 340, array( 'center', 'top' ) ); // Hard crop center top | |
// make the new size available in the media library (and image element etc.) | |
add_filter( 'image_size_names_choose', 'my_custom_images' ); | |
function my_custom_images( $sizes ) { | |
return array_merge( $sizes, array( | |
'catalog' => __( 'Catalogue Image' ), | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment