Archived topic
Format Video
15 replies · Started by Royal Rangers on May 23, 2020
When I use a video format on archive page is bad formatting.
https://ctrlv.cz/jvOL
https://ctrlv.cz/LiLB
For example I try insert a Instagram post and problem is too.
How I can fix it?
Hi there,
try adding this CSS:
.masonry-container .post .wp-block-embed {
min-height: 220px;
}
Hi David,
I add code to custom css.
In Opera/Chrome/Firefox:¨
https://ctrlv.cz/f1CK
https://ctrlv.cz/DRKo
Maybe is problem with Gutenberg embed block?
When I try resize browser window and back to fullscreen it work.
Try clearing your browser cache as its working for me.
The issue is that the Masonry option is calculating the height of the posts before the Embed has loaded.
Hi there,
Can you try adding this as a Hook Element (https://docs.generatepress.com/article/hooks-element-overview/) in the wp_footer hook?:
<script>
jQuery( window ).load( function() {
var masonry = $( '.masonry-container' );
if ( masonry ) {
masonry.masonry( 'layout' );
}
} );
</script>
Hi Tom, I try this. Doesn´t work.
Is it still added to the site?
Yes
I'm not seeing it in the source code. Can you deactivate your caching/minifying plugin?
Plugin is deactivated.
Hmm, it's like we need a trigger to fire once the videos are done loading so masonry reloads, but I'm not sure if that's possible.
You may be stuck with regular columns if you'll be loading videos like this, unfortunately.
I understand. Its surprised me because interesting function and doesnt work good for me.
I'll look at the core code and see if there's any way for me to make it aware of videos loading.
Thanks for your support!