Beans
Beans copied to clipboard
Gutenberg: Responsive video embeds
I added the following issue at the Gutenberg repository: https://github.com/WordPress/gutenberg/issues/11450
Comment from Ocean90: "Note that the width of the embed depends on the $content_width variable. Does your theme already support responsive embeds?"
The $content_width is defined in https://github.com/Getbeans/Beans/blob/development/lib/render/template-parts.php#L243 I tested a Youtube embed and it is resizing.
We are, however, not declaring theme support for responsive embeds.
I added the following code to the child theme functions file: add_theme_support( 'responsive-embeds' );
Video embed alignment center went from:
After adding the above code:
From WordPress Core-editor slack channel: https://wordpress.slack.com/messages/C02QB2JS7/
Why is it that a fresh install of WordPress 4.9.8 with Gutenberg 4.1.1 results in this behaviour for a YouTube Embed block with Wide format?
--
4 replies Marcus Anthony [11 hours ago] Here is a link for inspecting, if need be – it’s just a testing domain anyhow: https://www.m89.ca/352/this-is-a-wide-youtube-video-embed-in-gutenberg/
--
Marcus Anthony [11 hours ago] The theme in use is the Gutenberg starter theme from here: https://github.com/WordPress/gutenberg-starter-theme WordPress/gutenberg-starter-theme Showcasing Gutenberg: a theme to show the potential WordPress/gutenberg-starter-themeJul 27th, 2017 at 9:30 PM Added by GitHub
--
kjellr [11 hours ago]
I don’t believe the Gutenberg Starter Theme was ever updated with add_theme_support( 'responsive-embeds' );
. My hunch is that would take care of it: https://wordpress.org/gutenberg/handbook/extensibility/theme-support/#responsive-embedded-content
There was a similar issue recently with Twenty Nineteen and that solved it. (edited)
Marcus Anthony [10 hours ago] That was exactly the issue. Thank you, @kjellr!