Images all broken after migration and upgrade

I think a quick thumbnail regeneration might be the cure for this. Try using Regenerate Thumbnails or a similar plugin, but backup your uploads directory before proceeding. In order to just disable WP responsive images use this filter. /** * Disable WP 4.4 srcset */ add_filter( ‘wp_calculate_image_srcset’, ‘__return_empty_array’ );

How can I set image sizes and still have responsive images using the srcset attribute?

The srcset attribute is constructed from images that are the same aspect ratio. Create a few of those and you’ll be ok. add_image_size( ‘compare-offer-box’, 400, 300, true); add_image_size( ‘compare-offer-box-2’, 800, 600, true); add_image_size( ‘compare-offer-box-3’, 1200, 900, true); for example. The fourth, boolean, argument tells WP to crop to the exact proportions. To resize without cropping, … Read more

Create image formats with different qualities when uploading

1) A workaround by extending the WP_Image_Editor_GD class The problem is how to access the image sizes before we change the quality of intermediate jpeg images. Note that the image_resize() function is deprecated. We can use the jpeg_quality filter from the public get_quality method of the abstract WP_Image_Editor class: $quality = apply_filters( ‘jpeg_quality’, $quality, ‘image_resize’ … Read more

Responsive Theme Design: how have slideshow on desktops/tablets and static photo on mobile using same template?

Do not use server side browser sniffing. It will fail: The question here is how can you reliably detect mobile browsers in order to redirect them? The fact is: you can’t. Most people attempt to do this with browser sniffing—checking the User Agent string that the browser sends to the server with every request. However, … Read more

How to insert pictures without hard coded dimensions?

I don’t know if this is the best way to do this, but it works for me. In the functions.php of the theme you are using, put this: function remove_img_src($html) { $html = preg_replace(‘@(width|height)=”([0-9])+” ?@i’, ”, $html); return $html; } add_filter(‘image_send_to_editor’, ‘remove_img_src’, 10, 8); It uses regular expresions to change the output that is inserted … Read more

the_post_thumbnail responsive srcset not populating with custom image size

There’s not enough info to be sure this answer is definitive but here’s an attempt. Firstly make sure the image you are uploading is actually larger than the size you have defined. I see people upload images that are too small and then get this sort of result all the time. Secondly, WP will only … Read more

WP 4.4. responsive images browser choosing the “wrong” one

Concerning documentation there is this blog post on the Make Blog: Responsive Images in WordPress 4.4 To increase the 1600px limit mentioned in the comments try this: add_filter(‘max_srcset_image_width’, function($max_srcset_image_width, $size_array){ return 2000; }, 10, 2); Finally as already mentioned you should fix your calls to add_image_size add_image_size(‘news-large’, 1024, false); needs to be add_image_size(‘news-large’, 1024, 0, … Read more