ModernWP.blogspot.com

Methods to Forestall Youtube oEmbed from Overriding your WordPress Content material

Have you ever ever been to a website the place you discover that media parts resembling YouTube movies override different content material? This could occur if in case you have drop down menus, floating bars, lightbox popups and so on. On this article, we'll present you the way to forestall YouTube oEmbed from overriding your WordPress content material.

Instance:

Youtube oEmbed issue

Whenever you embed a video in WordPress, by default it doesn't have wmode=clear worth. What which means is that video parts have the best precedence and it'll override any floating or dynamic factor.

This will get actually annoying. So let’s check out the way to add ?wmode=clear to YouTube movies in WordPress with out utilizing the ugly iFrames technique.

All it's important to do is open your theme’s features.php file or higher but your site’s plugin file and paste the next code:

perform add_video_wmode_transparent($html, $url, $attr) 
add_filter( 'embed_oembed_html', 'add_video_wmode_transparent', 10, three);

Source

Tutorials