Last active
August 29, 2015 14:19
-
-
Save jonkpirateboy/ffdd0299cf047923091b to your computer and use it in GitHub Desktop.
Make custom image sizes chooseable from admin
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
function fmd_image_sizes() { | |
if ( function_exists( 'add_image_size' ) ) { | |
add_image_size( 'bigger_thumbnail', 300, 300, true ); //will be visible in admin | |
add_image_size( 'carousel', 1300, 380, true ); //will not be visible in admin | |
} | |
} | |
add_action( 'init', 'fmd_image_sizes' ); | |
function fmd_chooseable_image_sizes( $sizes ) { | |
return array_merge( $sizes, array( | |
'bigger_thumbnail' => __('Thumbnail, bigger'), | |
) ); | |
} | |
add_filter( 'image_size_names_choose', 'fmd_chooseable_image_sizes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment