Getbeans / Beans

Beans WordPress Theme Framework. The default branch is set to development, please switch to the master branch for production.
https://www.getbeans.io
Other
392 stars 61 forks source link

Gutenberg: Responsive video embeds #349

Open paaljoachim opened 5 years ago

paaljoachim commented 5 years ago

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?"

christophherr commented 5 years ago

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.

paaljoachim commented 5 years ago

I added the following code to the child theme functions file: add_theme_support( 'responsive-embeds' );

Video embed alignment center went from: screen shot 2018-11-06 at 14 27 02

After adding the above code: screen shot 2018-11-06 at 14 28 15


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!