Script for embedded youtube video no longer working

Hello,

I updated my site with your Sydney Pro Theme and now an embedded video is no longer shown correctly. As soon as I change anything in the plain text widget in which the script is inserted, and update the text widget, the video turns into a black box. This behaviour happens just by re-saving the text widget, even if I haven’t changed a bit to the content of the text widget.

Result before: https://snag.gy/X07doI.jpg

Result after: https://snag.gy/rzFBau.jpg

Is the theme processing widgets differently than before? My site is www.SAILORdudes.com by the way.

Thanks a lot in advance for your advise!
René

PS:

I created page “test” as a copy from the home page, and then just changed padding a tiny bit and saved the text widget. Any update in the text widget causes the video to go black.

Hope this helps to find the difference, thanks a lot!

Hello René,

WordPress 4.8 contains updated Text widget:

So please make sure that you add your code in Text tab of Text widget, not in Visual tab.

Please feel free to ask any other questions that you might have.

Kind Regards, Roman.

Hello Roman,

Thanks. I had taken notice of the updated text widget, but my code IS in fact entered in the text tab, not in the visual tab.

To be sure I have:

  • removed the existing text widget
  • updated the page
  • inserted the text widget again
  • copied my code into the text tab
  • published the page again

But still the text widget shows as a black bow on my test page http://www.sailordudes.com/test/

In my widget overview, by the way, the widget description still shows as “arbitrary text or html”. Is there some kind of reset needed somewhere perhaps?

Thanks,
Rene

Hello René,

You can try to use Enhanced Text Widget:

Kind Regards, Roman.

Hi Roman,

It makes no difference I’m afraid and am still puzzled. What I have now done is this:

  • Duplicate the Home page (published as )
  • Remove the text widget on the first row in which I have my video script
  • save the page
  • Insert the exact same widget on the same place where I had just deleted it
  • I’ve inserted the script in the plain text area (i.e. not in the vidual part)
  • Preview the page: video shows as black box

In other words: www.sailordudes.com (original home page) shows -correct- as:

And www.sailordudes.com/homecopy shows -incorrect- as:

Is there perhaps any way to find out what is different in the code of both pages as to try and find the root cause of it?

Thanks a lot,
René

Hello René,

Did you try to use the widget that I mentioned above instead of default Text widget?

Kind Regards, Roman.

Yes I did Roman, but no luck unfortunately. Of you want I can modify my test page and insert the widget you suggested…
René

Hello René,

It looks like this issue requires close inspection, this goes beyond our support policy. As an option, you can find a reputable freelancer on Upwork for this kind of service.

Kind Regards, Roman.

Hi Roman,
OK, sure, I understand. But meanwhile I found it (yay) and I thought just to let you know in case interested. It has appeared due to whatever unclear reason, that “out of nowhere” there are <p> and </p> codes inserted in the content of my text widget. No idea how that has happened… But I compared the source code of my home page (correct) and the homecopy page (incorrect) and then noticed these additional codes. Then I went back in WP and when I open the widget I also see them. Here is an example of these inserted codes:

    function labnolThumb(id) {
        var thumb = '<img src="https://i.ytimg.com/vi/ID/hqdefault.jpg" />',
            play = '</p>
<div class="play"></div>
<p>';
        return thumb.replace("ID", id) + play;
    }

So what I did is to remove these codes in order to get back to the script as it should be:

    function labnolThumb(id) {
        var thumb = '<img src="https://i.ytimg.com/vi/ID/hqdefault.jpg" />',
            play = '<div class="play"></div>';
        return thumb.replace("ID", id) + play;
    }

Then I saved the widget and now the homepage still looks fine. Re-opening the widget, however BRINGS BACK these unwanted codes. So I guess this is an issue with WP’s standard text widget ?! I now also understand why your suggestion didn’t work. Because I had left the wrong widget in my page. This screwed up the code for all following widgets in sequence, that I had tried. If I had simply removed the WP widget, your suggested widget would have worked.

Anyway, few lessons learned, hope you found my response also useful in case other experience the issue with the <p> codes.

Thanks a lot!
René

René, thank you for sharing that!

Kind Regards, Roman.