本文介绍了在 Wordpress 中更改 Vimeo/Youtube 默认大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何更改 Vimeo/Youtube 嵌入尺寸?
How to change Vimeo/Youtube embed sizes?
目前默认嵌入非常小 300x150,我需要最小 540px :(
Currently the default embed is very small 300x150, i need 540px minimum :(
在functions.php中使用snippet进行过滤,代码无效.
Using snippet to filter in functions.php, the code no works.
function rezzz_embed_defaults($defaults) {
$defaults['width'] = 350;
$defaults['height'] = 200;
return $defaults;
}
add_filter('embed_defaults','rezzz_embed_defaults');
请看截图 -> http://i.imgur.com/kv8SPEA.png
推荐答案
请仔细查看您的代码.我使用了您的代码,但更改了宽度和高度.
Please see your code carefully. I have used your code but changed width and height.
function rezzz_embed_defaults($defaults) {
$defaults['width'] = 540;
$defaults['height'] = 304;
return $defaults;
}
add_filter('embed_defaults','rezzz_embed_defaults');
您需要以适当的比例提供宽度和高度才能使用来自 youtube、vimeo 和其他来源的视频.
You need to provide width and height in proper ratio to use video from youtube, vimeo and other source.
您可以在此处
这篇关于在 Wordpress 中更改 Vimeo/Youtube 默认大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!