Automatically adjust size of all videos in you WordPress blog

Bloggers generally embed videos from various sources like YouTube, BBC, CNN etc. The videos available on these sites are of various sizes. One has to manually change setting for each of these video to fit it in your post area. You can define the custom video size for all of your embedded videos. Its quite simple. Just copy and paste following command in the “function.php” file. You have to change only the width and height in this code to make it common for all videos displayed on your blog.

 function mycustom_embed_defaults($embed_size){ $embed_size['width'] = 586; // Adjust values to your needs $embed_size['height'] = 500; return $embed_size; } add_filter('embed_defaults', 'mycustom_embed_defaults'); 
Both comments and pings are currently closed.

Comments are closed.

Powered by WordPress | Designed by: Themes Directory | Thanks to All Premium Themes, wordpress themes 2011