Solved

get YouTube video thumbnail from embedded video in Wordpress

Posted on 2016-08-03
7
19 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

How to create your own WordPress Theme Before I begin with the theme design tutorial, I would like to give you the basics of what is required to make a WordPress Theme. The most basic WordPress theme only requires 2 files: a style.css file and an…
WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
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…

776 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