Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. function ec_after_setup() {
  2. remove_action( 'after_setup_theme', 'extra_add_image_sizes' );
  3. add_action( 'after_setup_theme', 'ec_add_image_sizes' );
  4. }
  5. add_action( 'after_setup_theme', 'ec_after_setup', 1 );
  6.  
  7. function ec_add_image_sizes() {
  8. $sizes = array(
  9. 'extra-image-huge' => array(
  10. 'width' => 1280,
  11. 'height' => 768,
  12. 'crop' => true,
  13. ),
  14. 'extra-image-single-post' => array(
  15. 'width' => 1280,
  16. 'height' => 640,
  17. 'crop' => true,
  18. ),
  19. 'extra-image-medium' => array(
  20. 'width' => 627,
  21. 'height' => 999,
  22. 'crop' => true,
  23. ),
  24. 'extra-image-small' => array(
  25. 'width' => 440,
  26. 'height' => 264,
  27. 'crop' => true,
  28. ),
  29. 'extra-image-square-medium' => array(
  30. 'width' => 440,
  31. 'height' => 440,
  32. 'crop' => true,
  33. ),
  34. 'extra-image-square-small' => array(
  35. 'width' => 150,
  36. 'height' => 150,
  37. 'crop' => true,
  38. ),
  39. );
  40.  
  41. foreach ( $sizes as $name => $size_info ) {
  42. add_image_size( $name, $size_info['width'], $size_info['height'], $size_info['crop'] );
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement