Youtube video not showing in banner

My banner works fine. Just added a youtube video and it appears embedded on a regular page but the banner only doesnt show the youtube box at all.

Do I have to embed the raw youtube code instead?

Hmm, yeah, embeds are not really supported in the banner. We’d have to think of enhancing the feature.

2 Likes

I worked around it by customising my html with a bit of jquery to inject a youtube embed code:

So in the custom header:

<script>

function readyFn( jQuery ) {
    
    // check if sign up button showing
    if ( $('.sign-up-button').length ) {
        
         $('#banner-content').prepend("<div style='float:right; margin:0 auto'><iframe src='https://www.youtube.com/embed/ou6uUpu7Fy8?autoplay=0&rel=0&showinfo=0' frameborder=\"0\" allowfullscreen></iframe></div>");
    };
};

// when the entire window loads up:
$( window ).load( readyFn );
2 Likes

Only thing is the jquery only runs on the first load of the site so video disappears if you navigate to any of the topics :frowning:

If you use this plugin you can add a Youtube iframe to the banner post:
https://github.com/scossar/whitelist-iframe

6 Likes