Is it possible to change the default embed dimensions of an youtube (or another video) in WordPress for your current theme? I’ve searched for a plugin and some code, but I can’t seem to find any.
What I mean is the default embed size used when you just paste an youtube url in an post or page.
Open your themeâs
functions.php
file, and add the following code: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.
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:
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:To change the default embed size go to Settings > Media and just set a fixed width/height.
You also have the shortcode
where you can manually insert width and height as params. This shortcode will overwrite the default WP settings.
They’ve got rid of the fixed width/height option in the media settings of the new version of WordPress. Not sure why. It was useful!! Shortcodes don’t seem to work either.