Vimeo video embeds doesnt seem to work with ACF

I was trying to embed a vimeo link into a site using ACF custom fields and I am not getting anything in the front end but just a blank space as shown below.

I tried multiple approaches including a vimeo iframe as well as just pasting the link but nothing seems to work.

The embed code is given below

h3Watch a Video/h3
iframe src="//player.vimeo.com/video/75791532?title=0amp;byline=0amp;portrait=0" width="500" height="375" frameborder="0" allowfullscreen="allowfullscreen"/iframe

I checked multiple sites and all of them say I should be able to embed using the iframe or just the link, so I am not sure whats happening here.

Topic vimeo video-player embed Wordpress

Category Web


If the custom field contains just the URL you can achieve this using wp_oembed_get

$video_url = 'https://vimeo.com/75791532';
$video = wp_oembed_get( $video_url );
echo $video;

If the custom field contains other content as well something like this should work.

$content = '<p>Check out hte latest vid!</p>
     https://vimeo.com/75791532';

$content = apply_filters('the_content', $content);
echo $content;

the_content filter automatically applies the oembed filter.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.