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

RSS From Toby’s Blog

  • The Horrors of Covering Your Own Ass
    Today I emailed a very simple question to support@[companyname].com (2 sentences total). The automated response I got back was this: Keep in mind that the above was an auto-response and: It’s hard to read. Everything has the same import (e.g. none of it is important enough to call out separately). It’s long. It added absolutely-zero…
  • If something stupid makes money, then it’s not stupid.
    I’ve seen some stupid things in my life…And some of them were really really smart. I remember a story from decades ago where the U.S. military was looking to equip the Stealth Bomber with a fancy computer-driven video system so the pilots could see behind them. Well, the computers failed to get the job done,…
  • There is no destination.
    Coding is a process of failure followed by a moment of great joy. You've gotta ride through the failures to experience the joy...

More posts from themightymo.com

How I Optimized My Website Today

By The Mighty Mo! Design Co. | July 24, 2021

Today I decided to invest 1 hour optimizing themightymo.com. Below are the actions I took along with the results. Speed Benchmarks and Initial Observations Before starting on today’s speed optimization, Google Pagespeed Insights scored us as a “44”. There’s some files loading from the wp.com cdn (e.g. Jetpack’s cdn) – Google is penalizing me for…

How to give 2 IAM users web access to an S3 bucket

By The Mighty Mo! Design Co. | May 25, 2021

Here’s a quick tutorial about how to give 2 IAM users web access to an S3 bucket.

Where to go for website design inspiration

By Toby Cryns | May 5, 2021

I asked a design group I’m part of where they go for website design inspiration, and here are their recommendations

RSS From Toby’s Blog

  • The Horrors of Covering Your Own Ass
    Today I emailed a very simple question to support@[companyname].com (2 sentences total). The automated response I got back was this: Keep in mind that the above was an auto-response and: It’s hard to read. Everything has the same import (e.g. none of it is important enough to call out separately). It’s long. It added absolutely-zero…
  • If something stupid makes money, then it’s not stupid.
    I’ve seen some stupid things in my life…And some of them were really really smart. I remember a story from decades ago where the U.S. military was looking to equip the Stealth Bomber with a fancy computer-driven video system so the pilots could see behind them. Well, the computers failed to get the job done,…
  • There is no destination.
    Coding is a process of failure followed by a moment of great joy. You've gotta ride through the failures to experience the joy...