2015-11-03 40 views
0

我的WordPress主頁中嵌入了來自YouTube的視頻,我想動態更改此嵌入視頻,無需編輯我的WordPress設置。動態更改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> 
+1

你說「但它工作」嗎? –

+0

是的。是他做的。 –

+0

你是否認爲在iframe中插入那個頁面? –

回答

0

而是將其重定向到鏈接的,你爲什麼不下載使用YouTube的MP4轉換器的在線視頻,然後保留在的FTP WordPress。然後,也許你可以使用視頻標籤來顯示MP4文件。