Solved

get YouTube video thumbnail from embedded video in Wordpress

Posted on 2016-08-03
7
20 Views
Last Modified: 2016-08-28
I'm setting up a query of posts in a Wordpress theme.  I'd like to make it as simple as possible and grab the thumbnail of the YouTube video embedded in the posts.

I am embedding the Youtube videos by copying the URL to the content editor.  

What I'd like to do, is be able to pull that video URL and use the thumbnail generator to display that videos thumbnail in the query list as a link image.

something like:

<img src="http://img.youtube.com/vi/<?php echo the_content; ?>/#.jpg

I'm not sure if that's possible or the best practice, but doesn't seem too far out of the realm of what may be already native in Wordpress and I'm just not looking in the right place.  Any suggestions?
0
Comment
Question by:axessJosh
  • 4
  • 2
7 Comments
 
LVL 12

Expert Comment

by:William Nettmann
ID: 41741923
I doubt there is functionality in WordPress to do that directly, but this should put you on he right path:

http://tubularinsights.com/youtube-thumbnail-image/
0
 
LVL 7

Expert Comment

by:Alicia St Rose
ID: 41743514
Hi!
Why are you placing the post content in the image file path? You'd probably want to use a custom field for this.

As far as video thumbnails, I've used this plugin in the past:
https://wordpress.org/plugins/video-thumbnails/

Are you wanting the video image to be the featured image in your list of posts when you have a Video post? That's what this plugin can do for you?

You can also use custom fields and create a field for the video thumbnail image link you get from the tool William Nettmann pointed you to. Then you can use this variable in your query loop. Maybe just have a field for the Video ID and hardcode the rest of the URL in the template.

Advanced Custom Fields or Piklist are great for creating fields quickly!
0
 
LVL 2

Author Comment

by:axessJosh
ID: 41748177
yea, i figured it wasn't a native ability within wordpress and thought about custom fields which would do it for sure but i have a very needy client.  The fewer steps I give them the better.  

I was hoping to do some kind of PHP Explode or something (not even sure what I'm saying there) to be able to capture the Video ID from the url and use that to get the thumbnail.

any ideas?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 12

Expert Comment

by:William Nettmann
ID: 41748331
This expert suggested creating a Gigs project.
You have been given several ideas already - if you still don't know what to do, I suggest you consider posting a Gig and get someone to do it for you.
0
 
LVL 2

Author Comment

by:axessJosh
ID: 41749092
yes, and i think I alluded in my last comment that those ideas are good, but I was hoping to get more out of the content itself.

Is there a way to parse the URL out of the content and grab that video ID?
0
 
LVL 12

Accepted Solution

by:
William Nettmann earned 500 total points (awarded by participants)
ID: 41749235
0
 
LVL 12

Expert Comment

by:William Nettmann
ID: 41773569
The following question you participated in has been inactive for 14 days: get YouTube video thumbnail from embedded video in Wordpress

No new comments can be added to the question. You can still help resolve it by choosing the comment(s) with the most merit and following the prompts to close the question.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
Wordpress Horizontal Drop-Down Menu In this tutorial I will show you had to add a WordPress horizontal navigation menu to your theme. I have searched and searched for a good tutorial on creating a WordPress nav menu without adding a plug-in or us…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question