Set oEmbed Maximum Width
Caps the maximum width of embedded media such as YouTube and Vimeo via the embed_defaults filter to fit your content column.
PHPby SnipCraft
php
<?php
/**
* Limits the width of oEmbed content (YouTube, Vimeo, Twitter, etc.).
* Adjust the value below to match your theme's content column width.
*/
if ( ! function_exists( 'scseed_oembed_max_width' ) ) {
function scseed_oembed_max_width( $defaults ) {
$defaults['width'] = 800; // Maximum embed width in pixels.
return $defaults;
}
add_filter( 'embed_defaults', 'scseed_oembed_max_width' );
}#embeds#media#oembed#performance#responsive