Home Forums Front-end Issues WordPress 4.4 responsive images Reply To: WordPress 4.4 responsive images

  • Yes, I have, but for me that means disabling the built in responsive images of 4.4. It will only return alternates of the same image that are different sizes but a different ratio and the builders of the plugin and function that have been incorporated into WP do not include any way to filter or alter the images uses in the srcset.

    I have brought it up both before the release of 4.4 when it was being discussed and as an issue on trac after the release and this was met by either my comments being deleted or just ignored.

    Anyway, the way to do this is that when editing an image you can select alternate images (acf image fields attached to attachments) that will be used at different screen widths. These could be the same image cropped at a different ratio or a completely different image. Then build your own srcset using these values. You’ll need to disable wp filter added to “the_content” add your own and build a new function that works pretty much the same way as the WP function but also takes the custom field choices into account.