The best way to change the thumbnail image with YouTube video is to set it within your YouTube account, but if the video is not yours, or if you want something more custom than what YouTube allows, this is another way to do it.
Of course, change out “my_thumbnail.png” with your actual image and to get the embed code, find your video on YouTube and click Share and then Embed. Pay attention to the width and height and make sure it fits what you want.
Also, if you want the video to autoplay, you will need to add this code after the YouTube url:
?rel=0&autoplay=1
So, before you will have this:
After you will have this:
Of course, all this code must be placed in the Text tab of your WordPress editor.
Thanks to http://orangecountycustomwebsitedesign.com/ and https://support.bigcommerce.com for this bit of code.
Colin says
Great Code but there is a bug, it dosen’t work in Chrome. The video plays as soon as the page loads. Any ideas on how to fix this?
Laura Hartwig says
The only thing I can think of is to take out that “?rel=0&autoplay=1” from the URL. Also, I just read this article: http://areweconnected.com/video/how-to-add-a-custom-thumbnail-to-your-youtube-video/ and although I haven’t tried it yet, it could be another option.