Youtube dimensions wordpress Youtube dimensions wordpress wordpress wordpress

Youtube dimensions wordpress


Open your theme’s functions.php file, and add the following code:

if ( ! isset( $content_width ) ) $content_width = 600;

Remember to change the number 600 appropriately for your theme. It is the maximum width in pixels for your content area.

Once you do this, WordPress will automatically use that for the maximum width of your oEmbed elements (youtube videos, slideshare, etc).

via wpbeginner.com


The media settings have been removed. You can do it with a filter however.

function mycustom_embed_defaults($embed_size){    $embed_size['width'] = 600; // Adjust values to your needs    $embed_size['height'] = 500;     return $embed_size; // Return new size }add_filter('embed_defaults', 'mycustom_embed_defaults');

Taken from here http://shailan.com/2154/change-wordpress-default-embed-size-using-filters/


The currently accepted answer has an example that uses the following shortcode:

[youtube=http://www.youtube.com/watch?v=0Bmhjf0rKe8&w=640&h=385]

The shortcode [youtube] only works if you have the Jetpack plugin installed.

To make it work with WordPress with no Jetpack you can use the built-in [embed] shortcode like this:

[embed width=640 height=385]http://www.youtube.com/watch?v=0Bmhjf0rKe8[/embed]