[Resolved] image sizes

Home Forums Support [Resolved] image sizes

Home Forums Support image sizes

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #889474
    Marco

    Hello
    I’m just in the process of regenerating my thumbnails I I have a size like 768×419 – any idea where that’s coming from – I’ve not set that in the media settings – anyway to get rid of that size?

    Thanks

    #889737
    Tom
    Lead Developer
    Lead Developer

    I believe that size is generated by srcset: https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/

    Typically it’s a good thing, but it is possible to disable: https://wordpress.stackexchange.com/a/211985

    #889931
    Marco

    Thanks Tom

    Actually this does the trick:

    /* Media: remove default image sizes
    ---------------------------------------------------------------------------- */ 
    function themeprefix_remove_default_images( $sizes ) {
    	//unset( $sizes['small']); 	// 150px
    	//unset( $sizes['medium']); 	// 300px
    	unset( $sizes['medium_large']);	// 768px
    	//unset( $sizes['large']); 	// 1024px
    	
    	return $sizes;
    }
    add_filter( 'intermediate_image_sizes_advanced', 'themeprefix_remove_default_images' );
    #889936
    Tom
    Lead Developer
    Lead Developer

    Awesome! Thanks for posting your code 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.