Wordpress:在帖子中自动添加YouTube视频中的图像



我正在为一些文章添加一些YouTube视频,但它们没有图像。

有没有办法在帖子中自动添加视频图像?

我不想将图像存储在我的服务器上,我希望将 youtube 图像链接嵌入在帖子标题下方。

我看到一个将图像存储在服务器上的插件,但我希望来自 youtube 本身的图像。

例:

帖子标题

图像

<a href="https://i.ytimg.com/vi/05FTMpoyoK4/sddefault.jpg" imageanchor="1" ><img border="0" src="https://i.ytimg.com/vi/05FTMpoyoK4/sddefault.jpg" width="400" height="300" data-original-width="640" data-original-height="480" /></a>

有没有函数可以做到这一点?

您可以尝试使用以下格式

https://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
<a href="#" imageanchor="1" ><img border="0" src="https://img.youtube.com/vi/dsyXyz_kQuk/0.jpg" width="400" height="300" data-original-width="640" data-original-height="480" /></a>

最新更新