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
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
1 | function 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 |
10 | add_filter( 'embed_defaults' , 'mycustom_embed_defaults' ); |
No comments:
Post a Comment