• Resolved amycarolyn

    (@amycarolyn)


    Is there a way to retrieve the video thumbnail with a PHP template tag? This is for a video slider with thumbnail navigation. I have the plugin set to generate 1 thumbnail per video.

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Kyle Gilman

    (@kylegilman)

    Video thumbnails are set as the video’s featured image (post thumbnail) so if you know the video’s post ID you can get it using get_the_post_thumbnail( $post_id );

    Thread Starter amycarolyn

    (@amycarolyn)

    That’s awesome that it sets the featured image, but I’m loading several videos into a slideshow, and then I need to pull in the thumbnail for each below the slideshow. The thumbnail for each video is set in a custom field after I use your plugin to generate them. Let me know if there is a way to pull a specific size image this way. If not, I’ll just resize it down from the large size. Thank you for your help.

    Thread Starter amycarolyn

    (@amycarolyn)

    Also, is there a way to pull the information from the Video Thumbnail field shown under the Video file? Right now I’m copying that and pasting it into another meta field since I don’t know how to retrieve it.

    Plugin Author Kyle Gilman

    (@kylegilman)

    I guess I’m not following the specifics of your workflow so I don’t quite understand why looping through the post IDs of the videos in your slideshow and retrieving the post thumbnail for each one wouldn’t work. You can retrieve a specific size using the optional 2nd parameter of get_the_post_thumbnail.

    The custom field for the thumbnail URL shown in the attachment details is _kgflashmediaplayer-poster, but retrieving that field also requires the video’s post ID, since for obvious reasons it’s not saved to the parent post’s custom fields.

    • This reply was modified 7 years, 6 months ago by Kyle Gilman.
    • This reply was modified 7 years, 6 months ago by Kyle Gilman.
    Thread Starter amycarolyn

    (@amycarolyn)

    I’m not looping through multiple posts, I’m looping through multiple videos in only one post using an ACF Repeater Field. Each project/post has multiple videos that are displayed in a slideshow.

    It’s not a big deal for me to just pull the full size image and size that down for the thumbnail, I do appreciate you even taking the time to respond.

    One thing that would make things much easier for my client is if I could figure out how to get the thumbnail URL from the video file. There are multiple videos in the same post, so the post ID wouldn’t help me but I may be able to figure it out with the field name you provided. Thanks again.

    • This reply was modified 7 years, 6 months ago by amycarolyn.
    Thread Starter amycarolyn

    (@amycarolyn)

    Thought I’d pop back in really quick and say I was able to pull the URL directly using the attachment ID and the field name you provided. Thanks again for your help!

    Plugin Author Kyle Gilman

    (@kylegilman)

    I think I was being needlessly confusing, so I just want to clarify that when I was referring to a video’s post ID, I meant the attachment ID. Attachments are just a type of post in the WordPress DB, and I’ve gotten used to referring to them that way, but I don’t think that was clear from my earlier posts.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Retrieve Video Thumbnail with a Template Tag’ is closed to new replies.