Friday, December 30, 2011

Change the length and breadth of YouTube video automatically when you include it in the topic

Change the length and breadth of YouTube video automatically when you include it in the topic



 New versions of WordPress allows the user to add video from popular video sites like YouTube, Meta Cafe, so the book by adding a link the video directly and without any modification. A nice feature Araanna tired of additions often have problems. The problem with this way they show the video size is displayed on the site that hosts the video may not be suitable for you, especially if the template that you use less or offer more than the default. On this subject I will let you how to modify the width and height to appear automatically in all your posts.

In the function.php file, paste this code with adjustable height and width of what suits you best
1function mycustom_embed_defaults($embed_size){
2 if( is_single() ){ // If displaying a single post
3 $embed_size['width'] = 586; // Adjust values to your needs
4 $embed_size['height'] = 500;
5 }
6
7 return $embed_size; // Return new size



8}
9
10add_filter('embed_defaults', 'mycustom_embed_defaults');






The author of this code to call the video will be shown in a manner proportional in the sense that the rise will be commensurate with the offer if the offer is too large, but the rise will be 100 pixels video show 100 pixels high and supply is commensurate with, and vice versa. As what you care about is the width try to be the largest height of the display is large or is not acceptable to rely on when you modify the proportionality.

No comments:

Post a Comment