• Resolved bbtodd

    (@bbtodd)


    I just started using theme Twenty Twenty and I think perhaps this theme is creating an image that is 1980 pixels wide every time I upload an image. I have disabled all the other sizes in functions PHP but the 1980 image size is still being generated. Can anyone help me here? I must disable this before launching my site.

    function remove_default_image_sizes( $sizes) {
        unset( $sizes['1536x1536']);
        unset( $sizes['1980x1980']);
        unset( $sizes['2048x2048']);
        return $sizes;
    }
    add_filter('intermediate_image_sizes_advanced', 'remove_default_image_sizes');
    • This topic was modified 4 years, 2 months ago by bbtodd.
    • This topic was modified 4 years, 2 months ago by bbtodd.
    • This topic was modified 4 years, 2 months ago by t-p.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bbtodd

    (@bbtodd)

    I figured out the solution. You have to target this one by name not size. The code at the bottom will show you all the sizes your theme/site is generating. That’s how I determined the name of the image I need to disable is ‘twentytwenty-fullscreen’

    Disables image:
    unset( $sizes['twentytwenty-fullscreen']);//1980px width

    Displays all image sizes/names:

    $image_sizes = wp_get_additional_image_sizes();
    	print_r($image_sizes);
    	echo '<br>';
    	foreach ( $image_sizes as $key => $image_size ) {
    	    echo "{$key} ({$image_size['width']} x {$image_size['height']})";
    	}
    

    Dude I have a generell question, regarding this topic though. And since you wrote ” I have disabled all the other sizes in functions PHP” in your first post, I thought I ask.

    As I understand and found out, is that WordPress – everytime you upload an image, creates three different other sizes of that image: thumbnail, medium and large.

    We can even see that in settings-media and then it’s shown, but you can not edit it there.

    Is there a possibility to make it happen, that no other image of the uploaded image shall be made? Even though I work with the “Hello Elementor” Theme?

    Best regards

    Sean

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable the auto generated 1980px size image in WordPress TwentyTwenty’ is closed to new replies.