How to Make Youtube Gutenberg Block in WordPress Responsive

Today I had an issue where the Youtube Gutenberg block in WordPress was not maintaining the aspect ratio across devices. Once I discovered the cause of the issue, the fix was simple.

Add this code to functions.php to fix the Youtube block’s responsive issues

To fix the responsive issues with the Youtube block, simply add the following code to your functions.php file in your theme (or, alternatively, put it in your functional plugin):

// Add support for responsive embedded content.
add_theme_support( 'responsive-embeds' );

That’s it! Was this helpful?

Thanks, https://wordpress.stackexchange.com/a/332487!

Toby Cryns

Toby Cryns is a freelance CTO, expert WordPress developer, and teacher.

He offers free advice to improve your freelance biz.

He also publishes small droppings every now and them to https://twitter.com/tobycryns and https://twitter.com/themightymo.com

Follow Toby's contributions on Github and WP.org.