Hello @blackdeth73 !
I’m very sorry to hear that you’ve experienced this issue!
From my checks it may be due to the layout running before Lazy Loading and thus not getting the correct dimensions for the images.
I’ve managed to find a solution for this using a small snippet of JS code to trigger the layout once more after Lazy Loading finishes:
<?php
add_action('wp_footer', function() {
?>
<script type="text/javascript">
setTimeout(function() {
jQuery('#blog-entries').masonry();
}, 500);
</script>
<?php
});
To install, please copy the code to a .php file and place the file in wp-content/mu-plugins directory. Please create the directory if it doesn’t exist.
Kind regards,
Pawel
@wpmudev-support9
Thank you so much for your quick reply.
I copied the code as shown in the screenshot in the wp-content/mu-plugins directory, wrote a php file and uploaded it.
https://paste.pics/eeccfbae4e7cbb8dfbccf1964609732d
Some grids still have images overriding titles.
https://paste.pics/d37fe63aada4de1487584db4893c0b23
Hello @blackdeth73 !
Please try changing the 500 in the code to 1000, I think we need to adjust the delay here for the second layout trigger.
Kind regards,
Pawel
Hi @blackdeth73
Can you let us know if you are using the Smush > Lazy Load?
I can see some Lazy load doesn’t seem from Smush.
Those grid issues are usually related to Lazy Load, can you disable Lazy Loads to verify if makes any difference?
Best Regards
Patrick Freitas
Hi @wpmudevsupport12
It is set to use “Lazy Load”. This is the most important reason to use “Smush”.
I checked after disabling the “Lazy Load” function, but it doesn’t make any difference.
The layout looks fine where I am.
can you check please?
Hi @blackdeth73
Are you using any cache for site – either as a plugin or some theme option or server-side cache? This is something that often “messes up” things with custom code.
If there is any cache, can you try clearing it up and, temporarily, disabling and then testing Pawel’s code again after that?
Kind regards,
Adam
@wpmudev-support8
Yes, Pawel’s code is applied now. It looks like the cache was there before.
It’s normal now.
Thanks for help.
-
This reply was modified 4 years, 2 months ago by
blackdeth73.