Viewing 5 replies - 1 through 5 (of 5 total)
  • r1k0

    (@r1k0)

    Hey @avagp,

    I have tried to replicate the issue on my end, but I was unable to get the same result. For me, the YouTube block uses the default aspect ratio 16:9 (the default width 500 px and height 281 px of the <iframe> tag).

    This could be coming from a plugin conflict that interferes with the normal functionality of the block. If you are still experiencing this issue. I would advise you to deactivate all the plugins, comment out any additional CSS targeting the block, and if this resolves the problem. Reactivate each plugin until you find the one causing the issue.

    Before doing all the steps above, create a back up of your site.

    Regards,
    Erick

    Thread Starter Radical Dreamer

    (@avagp)

    i did all the above:

    No custom CSS

    No custom CSS

    Deactivated all plugins (except Woocommerce)

    None activated plugin (except Woocommerce)

    But i still get this issue…

    Unless it is woocommerce

    r1k0

    (@r1k0)

    Hey @avagp,

    It’s highly unlikely that it is WooCommerce plugin. I have made some observation from third screenshot. It seems that the YouTube block is inside a column block with the text on the right, and that column might be a bit constrained, leading it to auto convert to 9:16. See screenshot below. This is the CSS forcing the block to change to 9:16.

    I will keep on investigating further to get to the root of this. Finally, when you add the YouTube block on its own (without putting it in a column), does it display as 9:16?

    r1k0

    (@r1k0)

    The problem comes from conflicting CSS classes wp-embed-aspect-* from the parent div, which overrides the same class in the figure (child element).

    Parent:

    <div class="wp-block-cover alignfull has-parallax wp-embed-aspect-9-16 wp-has-aspect-ratio" ...>

    Child:

    <figure class="wp-block-embed wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">
    <div class="wp-block-embed__wrapper">
    <iframe src="..." />
    </div>
    </figure>

    But it is a bit strange to include that class in the cover block, which is not an embed, and the block has a style option to apply an aspect ratio. From your site, I see that these classes, wp-embed-aspect-9-16 wp-has-aspect-ratio, are included in every cover block. Consider removing them in each cover block, as they are not needed in this block.

    Hope this helps. If you have any more questions, don’t hesitate to ask. Please consider marking as resolved if this fixes your issue.

    Aspect ratio styling option in cover block
    Remove these classes

    Cheers,
    Erick

    Thread Starter Radical Dreamer

    (@avagp)

    Thank you!

    That was it. The cover block had classes that didn’t correspond and interfere with the embed block

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘youtube block always shows in 9:16’ is closed to new replies.