Skip to content

Instantly share code, notes, and snippets.

@DigitalEssence
Created February 18, 2015 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DigitalEssence/faf84e2ee33a4939e545 to your computer and use it in GitHub Desktop.
Save DigitalEssence/faf84e2ee33a4939e545 to your computer and use it in GitHub Desktop.
Wordpress - Add Custom Image Size to Admin Area
//////////////////////////////////
// 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