Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Here is such a way, courtesy of StackExchange user Birgir Erlendsson. from post: http://www.zigpress.com/2015/12/11/how-to-disable-responsive-images-in-wordpress-4-4/
- add_filter('wp_get_attachment_image_attributes', function($attr) {
- if (isset($attr['sizes'])) unset($attr['sizes']);
- if (isset($attr['srcset'])) unset($attr['srcset']);
- return $attr;
- }, PHP_INT_MAX);
- add_filter('wp_calculate_image_sizes', '__return_false', PHP_INT_MAX);
- add_filter('wp_calculate_image_srcset', '__return_false', PHP_INT_MAX);
- remove_filter('the_content', 'wp_make_content_images_responsive');
Advertisement
Add Comment
Please, Sign In to add comment