Vimeo thumbnails
I use Advanced Custom Fields to show Vimeo videoes on a site I am creating for a client - The client pastes the vimeo ID (the last letters in the url) in a field, and the video is shown. But I would also like to show thumbnail of the video, I am using the following (not working code) for this:
?php
$imgid = the_field('video_link');
$hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$imgid.php"));
echo $hash[0]['thumbnail_medium'];
?
This code only shows the video-ID on the page. But if I, instead for "the_field('video_link')" writes the video-ID in the code - the thumbnail URL is displayed. Does anyone know what I am doing wrong? :)
Topic vimeo advanced-custom-fields custom-field Wordpress
Category Web