If you want resulting oEmbed code to scale to a specific size (width) in WordPress, you can do this really easily by setting the $content_width
global variable before calling your oEmbed processing.
Example:
global $wp_embed, $content_width; $content_width = '600'; // set to desired width $string_with_embedded_content = $wp_embed->autoembed($string_with_oembed_url);
I only recently ran across this feature (just recently had the need for it), though it’s been around for at least a year. In talking with some other devs, it seems to not be a widely known feature – hopefully this helps.
The global $content_width does more than that, it sets the width of the “content” area in the main theme’s view. So a theme should be setting this as the first thing in the functions.php file.
It controls the maximum width allowed for any content in the theme that is added in a normal manner. This means both oEmbedded stuff and things like images added to posts.
I guess you might want to do that if your theme only has one content width area.
What, not plugin on your site showing Twitter references? 🙂
Okay then: http://twitter.com/#[...]754175569920
It seems Youtube’s new player implementation is buckling the formatting on my blog – the embedding no longer accounts for the height of the player bar and so reduces the size of the video leaving nasty black vertical bars on all my embedded clips – is there a way add the extra 35px player height and maintain the correct proportions of the clip (while still maintaining my 600px width)
example:http://zissou.com/20[...]art-matters/
In this example the clip should be 600px x 338px +35px height for the container
I would be very grateful for any assistance