Solved

get YouTube video thumbnail from embedded video in Wordpress

Posted on 2016-08-03
7
17 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 12

Expert Comment

by:William Nettmann
Comment Utility
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
Comment Utility
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)
Comment Utility
0
 
LVL 12

Expert Comment

by:William Nettmann
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Do you think that WordPress is just for blogs?  Think again!  WordPress is really a fantastic all around platform that you can use to develop websites on.  Integrated into its basic functionality is the ability to create pages using your choice of a…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now