• I’m trying to figure out how to get the embedded videos ([embed] [/embed]) I include in my posts displayed properly. By prpoperly, I mean that neither the default image nor the video should get cropped, keeping and proportions should be kept when resizing.

    My posts template have a sidebar, so that the post content width doesn’t correspond to the theme template full width.

    Currently, on a full width screen, the YouTube default image doesn’t fit the content width when loading the page: its width is the full screen theme width, so that with that sidebar, the default image is cropped
    On mobiles, width of the default image is fine (the sidebar appears below the content on that viewport), but I get black strips over and below the default image.

    In both case, however, when playing the video, it adapts to the content width, so that it’s not cropped.

    Does WordPress has proper native support for responsive embed?
    Should I always add a manual div around embeds to get them properly sized.
    Or is there something wrong with my post template?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The block editor has an option for the theme to support responsive embeds, but the theme has to call that function.
    Or the theme can provide its own method of styling the embeds to be responsive. Or a plugin can do it.
    Because videos are often in an iframe, which is difficult to style, the theme might not even have code for it.

    Thread Starter T4ng

    (@schwipps)

    Thanks for your answer, Joy.

    WordPress blocks are a WP5 feature, and we’re still using WordPress 4. Is there an option in WP4 for this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Responsive embed’ is closed to new replies.