• Resolved Klooven

    (@klooven)


    Hello.

    I’ve created a shortcode for embedding YouTube videos in a slightly modified player from the normal YouTube embed player included in WordPress.

    It outputs this code:

    <iframe id="navid-player" type="text/html" width="720" height="405"
    src="https://www.youtube.com/embed/VIDEOID?disablekb=1&rel=0&showinfo=0&color=white"
    frameborder="0" allowfullscreen>

    For some reason it messes up everything when use it. Everything in the page is white, except the page title in the top.

    I’ve tried the shortcode in other themes (like Twenty Sixteen), and it works perfectly in those themes.

    What could the problem be? Could it be fixed?

    Thanks for any help! ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi there,

    It works in Cubic for me if I add the closing iframe tag at the end of the code:
    </iframe>

    • This reply was modified 7 years, 9 months ago by dcoleonline.
    Thread Starter Klooven

    (@klooven)

    Oh, that was an easy fix!

    Thanks.

    Do you know how I can make this appear in the master header when the post format is “Video”, like it happens when a normal YouTube video (just pasting the video adress in the editor) is embedded?

    The theme automatically moves the YouTube embed to the top using JavaScript.

    When I tried the following code in a post with the video post format, it showed a slightly different player:

    <iframe id="navid-player" type="text/html" width="720" height="405"
    src="https://www.youtube.com/embed/KiS8rZBeIO0?disablekb=1&rel=0&showinfo=0&color=white"
    frameborder="0" allowfullscreen></iframe>
    

    So as long as your shortcode outputs the HTML, it looks like it should just work with the shortcode and the video post format.

    Overriding the core WordPress YouTube embed isn’t specific to the Cubic theme, so you might find some help with that in the Development forum.

    Thread Starter Klooven

    (@klooven)

    Hello.

    I tried to copy the code from your last post straight to the editor. It worked, the video was moved to the master header.

    When I generate the player using the shortcode:

    [navid id="VIDEOID"]

    It generates:

    <iframe id="navid-player" type="text/html" width="720" height="405"
    src="https://www.youtube.com/embed/VIDEOID?disablekb=1&rel=0&showinfo=0&color=white"
    frameborder="0" allowfullscreen></iframe>

    But for some reason the video doesn’t go to the master header.

    Seems that the shortcode does something, so that the JavaScript that should move it to the master header doesn’t work.

    Do you know any possible solution to this?

    • This reply was modified 7 years, 9 months ago by Klooven.

    Hi again,

    Hmm, it sounds like this may be related to the custom shortcode rather than the theme itself. I wouldn’t be able to help troubleshoot the shortcode, but you may have some luck over in the developer forum.

    They’ll probably need to see how you’ve written it, so they can help you determine whether something needs to be changed with how it is executed.

    Thread Starter Klooven

    (@klooven)

    Ok, thanks for the help!

    Have a good day.

    You bet

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom YouTube embed makes page white’ is closed to new replies.