Slider in WordPress not working after 4.4.2 update

My latest theme for real estate has had tremendous success, users have generally had little to no issues so far until the WordPress 4.4.2 update. This bundle of joy  comes with a feature to support responsive image, not that this isn’t great, who doesn’t like responsive anyways? Well you’ll be surprised. Without getting into too much detail, the srcset tag that’s introduced isn’t playing too well with guys who have SSL activated (you can read more here) , then there’s the other guys, who’s sliders are just not loading anymore.

After spending hours on the console trying to debug this I gave up, there were no errors produced but I could see that the images were loaded (not displayed). So long story short, I took a dirty shortcut and disabled the srcset tags AKA the new responsive images feature. So far everything is great, but i really wish there was a better solution, or the browsers catch up.

Paste this little bit of magic in your functions.php and say goodbye to the awesome but frustrating srcset tag:

//removes srcset that causes issues with some sliders in WordPress 4.4.2

add_filter( 'max_srcset_image_width', create_function( '', 'return 1;' ) );

Leave a Reply

Your email address will not be published. Required fields are marked *