Site logo

Archived topic

Missing iframe declaration for embedded Youtube when using GP Block Element

2 replies · Started by Zoltan on December 18, 2021

Viewing posts 1–3 of 3

Hello,

WP 5.8.2, GP Theme, GP Blocks and GP Premium only, nothing more.

Embedding Youtube block on WP Page or WP Footer Widget works nice.
Embedding Youtube block into GP Container and Grid works fine if it is placed inside a WP Page.
Embedding Youtube block into an GP Block Element-GP Container and Grid does not work, only the Youtube links shows.

As I can see, the iframe declaration is missing when using GP Block Element.
The correct one, when embedding works:
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube
wp-embed-aspect-16-9 wp-has-aspect-ratio">

<iframe loading="lazy" title="Dynamic Typography Demonstration" width="1280" height="720"
src="https://www.youtube.com/embed/mNAlQDNyJPg?feature=oembed" frameborder="0" allow="accelerometer; autoplay;
clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

</figure>

The wrong one, when embedding does not work using GP Block Element:
/*<figure class="wp-block-embed alignfull is-type-video is-provider-youtube wp-block-embed-youtube
/*wp-embed-aspect-16-9 wp-has-aspect-ratio">
/*

/*https://www.youtube.com/watch?v=mNAlQDNyJPg
/*

</figure>"

The same problem as was already reported in https://generatepress.com/forums/topic/youtube-embed-works-fine-in-admin-panel-shows-only-url-on-live-site/#post-2052894

KR, Zoltán

Hi Zoltan,

Can you go to this website, paste the video URL there, copy the generated Embed code?
https://embedresponsively.com/

Then paste the embed code to a HTML block in the block element.

Let me know if that works

Hi Ying,

Yes, it works. Thank you for your workaround solution, however I wonder what is the reason for the Youtube Block failure (missing iframe code) when using together with GP Elements-Block. Who should be responsible to solve it, WP or GP?

KR, Zoltán

This archived topic is closed to new replies.