montreyw / Theme-Redesign-and-SEO-Overhaul

Earmilk redesign project
2 stars 0 forks source link

Default YouTube Embeds size is wrong on all device widths #22

Closed andrebu closed 8 years ago

andrebu commented 8 years ago

The static width and height in pixels set by the native embed function messes up the size of all YT Embed videos.

One proposed but untried solution is to use a function in function.php:

add_filter( 'embed_defaults', 'change_embed_size' );

function change_embed_size() {
    // Adjust values
    return array('width' => 100, 'height' => 100);
}
andrebu commented 8 years ago

This fixes #22

/* YouTube video Embeds */
.entry .vvqbox.vvqyoutube {
    min-width: 100%;
    display: block;
    width: 100% !important;
    height: auto !important;
}
.entry .vvqbox.vvqyoutube span {
    min-width: 100%;
    display: block;
    width: 100% !important;
    height: auto !important;
}
.entry .vvqyoutube span img {
    height: auto;
}