Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gutenberg: Responsive video embeds #349

Open
paaljoachim opened this issue Nov 4, 2018 · 2 comments
Open

Gutenberg: Responsive video embeds #349

paaljoachim opened this issue Nov 4, 2018 · 2 comments

Comments

@paaljoachim
Copy link

I added the following issue at the Gutenberg repository:
WordPress/gutenberg#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
Copy link
Member

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
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants