Created
September 21, 2014 01:45
-
-
Save bradpotter/b6ccf56db689bc8be974 to your computer and use it in GitHub Desktop.
Add and make new image sizes available in WordPress Uploader for Daily Dish Pro Theme - Reference http://www.wpmayor.com/how-to-add-custom-image-sizes-to-wordpress-uploader/
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 sizes | |
if ( function_exists( 'add_image_size' ) ) { | |
add_image_size( 'featured', 720, 405, TRUE ); | |
add_image_size( 'archive', 340, 191, TRUE ); | |
add_image_size( 'sidebar', 100, 100, TRUE ); | |
} | |
//* Make new image sizes available in WordPress Uploader | |
add_filter('image_size_names_choose', 'my_image_sizes'); | |
function my_image_sizes($sizes) { | |
$addsizes = array( | |
'featured' => __('Featured'), | |
'archive' => __('Archive'), | |
'sidebar' => __('Sidebar') | |
); | |
$newsizes = array_merge($sizes, $addsizes); | |
return $newsizes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment