Setting a post’s featured image from an embedded YouTube video

Posted by Prem Tiwari | Updated on

If you include multiple URLs in your post, you’ll need to modify the code to properly find the YouTube URL. This can be done by iterating through the $attachments collection and sniffing out what URL’s look like a YouTube URL.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers