Solved

get YouTube video thumbnail from embedded video in Wordpress

Posted on 2016-08-03
7
22 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 8

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
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Now that you've installed WordPress 2.9 (http://www.experts-exchange.com/articles/Web_Development/Blogs/WordPress/WordPress-2-9-What-to-Expect-When-Upgrading-to-WordPress-2-9.html?) on your site, you need to install some plugins to get the most out …
WordPress has made it easy to create scalable sites based on their powerful CMS, but as great as WordPress is, there are some SEO issues that haven’t been addressed out of the box.  Fortunately these problems can be solved with a few plugins.  The f…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

626 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