Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 动态更改WordPress上的嵌入视频URL_Html_Wordpress_Video_Youtube - Fatal编程技术网

Html 动态更改WordPress上的嵌入视频URL

Html 动态更改WordPress上的嵌入视频URL,html,wordpress,video,youtube,Html,Wordpress,Video,Youtube,我的wordpress主页有一个来自youtube的嵌入视频,我想动态更改此嵌入视频,而无需编辑我的wordpress设置 我试图创建一个自定义网页重定向到我的视频,所以我需要做的就是运行一个脚本来更改此网页的URL,但它不起作用,关于如何修复它的任何线索 我曾经使用以下代码重定向: <!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8">

我的wordpress主页有一个来自youtube的嵌入视频,我想动态更改此嵌入视频,而无需编辑我的wordpress设置

我试图创建一个自定义网页重定向到我的视频,所以我需要做的就是运行一个脚本来更改此网页的URL,但它不起作用,关于如何修复它的任何线索

我曾经使用以下代码重定向:

<!DOCTYPE HTML>
<html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="1;url=http://https://www.youtube.com/watch?v=Eho8HDtkCiU">
        <script type="text/javascript">
            window.location.href = "http://https://www.youtube.com/watch?v=Eho8HDtkCiU"
        </script>
        <title>Page Redirection</title>
    </head>
    <body>
        <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
        If you are not redirected automatically, follow the <a href='http://https://www.youtube.com/watch?v=Eho8HDtkCiU'>link to example</a>
    </body>
</html>

window.location.href=”http://https://www.youtube.com/watch?v=Eho8HDtkCiU"
页面重定向
如果没有自动重定向,请按照

与其将视频重定向到链接,不如使用YouTube-to-MP4转换器在线下载视频,然后将其保存在WordPress的FTP中。然后,也许你可以使用视频标签来显示MP4文件。

你是说“但它正在工作”?你认为用iframe在wordpress中插入该页面吗?