0

I'm currently developping a custom page (a handmade one) for my Wordpress website. This page is used to check the validity of a token, if the token is still up, some videos are shown on the page otherwise nothing is shown.

Everything works perfectly for the token, but when I want to insert my <iframe>, it doesn't work. I can see there is something on the page, but not the video and when I inspect the element on Mozilla I have this :

<iframe src="video url" allow="autoplay; encrypted-media" allowfullscreen="" frameborder="0" width="560" height="315">
   #document
      <html>
         <head></head>
         <body></body>
      </html>
   </html>
</iframe>

On another page, I'm using Elementor to build the page and to show some videos. When I inspect the element, I can see there are lot of stuff between <body></body> under the <iframe>.

So how can I put a youtube video in my custom page ?

4
  • I'm not familiar with Elementor, is this a general question or is this something that only fails in Elementor? Are you aware of using OEmbed to embed youtube videos? How are you trying to insert the iframe? Via JS? A filter? A post meta value?
    – Tom J Nowell
    Commented May 7, 2018 at 12:13
  • It only fails on my custom page. Actually, I'm developping a page from scratch in which I call everything I need from Wordpress (the header and the footer for exemple). This page is a "simple" php page, so I'm trying to insert the iframe directly without using Js or a filter, so maybe that's why it doesn't work ?
    – Panchoa
    Commented May 7, 2018 at 12:18
  • hmmm so when you say you're inserting it, do you mean you went to Youtube and copy pasted the iframe embed code into post content? Or are you inserting it via javascript code? Or is the iframe literally hardcoded into your PHP file yet still doesn't display? I asked a few important questions in my first comment but I'm not sure any of them were answered. Edit your questions with as much information as possible, leave no rock unturned, even if you think it's unimportant/irrelevant
    – Tom J Nowell
    Commented May 7, 2018 at 13:26
  • Well, I tried my page on another computer and... it worked. So basically I guess it's my web browser which causes some problems. Problem solved then. To answer your question, the iframe is hardcoded in my php file. I'm not using any javascript code to insert it nor a filter nor a post meta value. The iframe doesn't fail with elementor and I don't know what OEmbed is actually.
    – Panchoa
    Commented May 7, 2018 at 13:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.