Youtube / iframe sizes being ignored (4 posts)

  1. activeoahu
    Posted 4 years ago #

    I am using the latest version of WordPress with the "Hatch" theme.

    I have tried the following:

    youtube embed code with size and height (iframe and flash)

    changing the embed size for media in the settings page

    plugins like: Smart Youtube Pro and Artiss Youtube embed

    jetpack shortcode

    Every single time, despite defining a size of 640x360, the videos appear 940x520, the full width of the page content area.

    Please help!

  2. activeoahu
    Posted 4 years ago #

    Ok I resolved the issue but I'm not sure why this was interfering.

    I realized that since the videos were capping at 940px (100% of the content area width) it had to be something in the theme.

    I opened up the theme editor, hit 'ctrl-f' to find a mention of iframe and found this:

    .hentry img, .entry-content iframe, .entry-content object, .entry-content video, .entry-content embed { max-width: 100%}

    so I changed the max width and height to this:

    max-width: 640px; max-height: 360px

    Now it works. Hope this helps someone.

  3. Jade28012
    Posted 3 years ago #

    how did you add on editor?

  4. kingmaico
    Posted 3 years ago #

    Hi, I ran into the same problem. I presume the max-width:100% style is there to ensure the responsiveness of the theme on various platforms.
    So changing it may ruin an important characteristic.

    I tried a very simple thing: a hardcode style on the iframe and it worked. Also the video stays responsive.

    <iframe style="width: 560px; height: 315px;" src="http://www.youtube.com/embed/kc7ShlmEKVg?rel=0" allowfullscreen="" frameborder="0"></iframe>

    Here's the page: http://www.grafsteeninmozaiek.nl/monument-in-mozaiek/

Topic Closed

This topic has been closed to new replies.

About this Topic