WP:使用高级自定义字段将Vimeo ID输入到iframe代码中

时间:2013-04-23 09:01:33

标签: wordpress vimeo

我在其他情况下使用过这个并且似乎有用,但是vimeo会抛出一个错误......

<?php 
    echo '<iframe src="http://player.vimeo.com/video/';
        the_field('vimeo');
    echo ' title=0&amp;byline=0&amp;portrait=0" width="1000" height="565" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
?>

1 个答案:

答案 0 :(得分:1)

尝试

<?php 

$videoID = get_field('vimeo');

echo '<iframe src="http://player.vimeo.com/video/'.$videoID.'&amp;title=0&amp;byline=0&amp;portrait=0" width="1000" height="565" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';

?>