Select image sizes you want to be uploaded

If I am not mistaken, WordPress just creates these sizes. The only thing you can say is which image you want to pick of these sizes. You can use this piece of code to make the sizes appear inside of the dropdown. Make sure to place this inside the functions.php after adding the image_sizes.

function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array(
      'home-hero-s' => __( 'home-hero-s' )
    ) );
  }
  add_filter( 'image_size_names_choose', 'my_custom_sizes' );

Where you see 'home-hero-s' that is the name of your custom image size and the next ( 'home-hero-s' ) is the name you give it to show in the dropdown of the size selector. I don’t know any function that helps with selecting the size you want to upload. So I hope this helps you.

Leave a Comment