Advertisement
PittsburghChris

Adding a new image size to WordPress Functions file

Oct 24th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. // Add additional image sizes
  2.     add_image_size( 'homepage-thumb', 535, 350, true );
  3.  
  4. // Show new image size in admin are of media section
  5. add_filter( 'image_size_names_choose', 'yourTheme_custom_image_size' );
  6.  
  7. function yourTheme_custom_image_size( $sizes ) {
  8.     return array_merge( $sizes, array(
  9.         'homepage-thumb' => __( 'Homepage Thumbnail' ),
  10.     ) );
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement