Skip to content

Instantly share code, notes, and snippets.

@bradpotter
Created September 21, 2014 01:45
Show Gist options
  • Save bradpotter/b6ccf56db689bc8be974 to your computer and use it in GitHub Desktop.
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/
//* 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