TheHungryGeek on "[Plugin: Instagram Feed] Latest Update Breaks Autoptimize"

ساخت وبلاگ

So the latest update breaks Autoptimize.

Something changed and with the plugin it no longer renders some of the javascript properly.

Any fixes?

FYI I have this custom code for my page:

<!-- Insta Square Box Dynamic Resize AND Fix for browsers that do not support Object-Fit CSS Property -->
<script type="text/javascript">
jQuery(document).ready(function() {
//setTimeout(function(){
//jQuery(".entry-content:contains('SGD $')").html(function(i,t){ retu t.replace(/SGD $/g, 'SGD$') }); // Singapore currency format hack for Xoogu
// var cwx = jQuery('#after-slider-widget-left #sb_instagram img').width();
// jQuery('#after-slider-widget-left #sb_instagram img').css({'height':cwx+'px'}); // this is kind of redundant with CSS height specification
//}, 5000);
if (document.createElement("detect").style.objectFit === "") { // creates objectfit class if there is browser support document.getElementsByTagName("html")[0].className += " objectfit";
}
if (jQuery(window).width() > 480 && !jQuery('html').hasClass("objectfit")) { // only runs if no object-fit class and width greater than 480px
setTimeout(function(){ jQuery('#sb_instagram .sbi_photo_wrap').each(function () { var jQuerycontainer = jQuery(this), imgUrl = jQuerycontainer.find('img').prop('src'); if (imgUrl) { jQuerycontainer .css('backgroundImage', 'url(' + imgUrl + ')') .addClass('compat-object-fit'); } });
}, 5000);
}
});
jQuery(window).resize(function() {
var cw = jQuery('.sbi_photo_wrap.compat-object-fit').width();
jQuery('.sbi_photo_wrap.compat-object-fit').css({'height':cw+'px'}); // forces image height=width for IE
if (jQuery(window).width() < 768) {
var cwx = jQuery('#after-slider-widget-left #sb_instagram img').width();
jQuery('#after-slider-widget-left #sb_instagram img').css({'height':cwx+'px'}); // forces image height=width for non-IE
} else {
jQuery('#after-slider-widget-left #sb_instagram img').css('height', '');
}
});
</script>

https://wordpress.org/plugins/instagram-feed/

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 236 تاريخ : چهارشنبه 9 تير 1395 ساعت: 23:24