Hello, I’m seeing an odd space (that used to not be there) between my rows on my Portfolio page. It only shows up on certain screens though. The images/portfolio items should be right next to each other – masonry style, but for some reason they aren’t.
I can provide a screenshot if that is helpful.
Hey Hurricane,
Thank you for the inquiry.
Did you install a lazy load plugin or any plugin related to images? The plugin might be preventing the isotope script from correctly adjusting the position of the portfolio items. To fix the issue temporarily, you can use this css code.
add_action('wp_footer', 'ava_auto_resize');
function ava_auto_resize(){
?>
<script>
(function($){
var int = window.setInterval(function(){
$(window).trigger('resize');
}, 1500);
$(window).on("load", function () {
setTimeout(function() {
clearInterval(int);
}, 500);
});
})(jQuery);
</script>
<?php
}
Best regards,
Ismael
Hi, so I did have Smush activated and when I add the Portfolio page to the pages not to Lazy Load it appears to have fixed it. Thanks! I noticed that you mention that the code above would only temporarily fix the problem? Why is that?
Hi!
Thank you for the update.
The script above will trigger a browser resize which should force the gallery items to reposition and remove the unwanted spaces, it is a temporary fix until we figured out the actual cause of the issue. You can now remove it since we already confirmed that the issue is caused by a plugin. If you want to re-enable lazy loading option from the plugin, you can add the script back.
Cheers!
Ismael