1two3
Expert
Super Volunteer
Member Likes (0)
I had an issue with the Social Marketing plugin sitting behind my youtube videos. I found this solution online and thought it would be useful to share here.
Add the following to your function.php file
function add_video_wmode_transparent($html, $url, $attr) {
if (strpos($html, "<iframe title=" ) !== false) {
$search = array('" frameborder="0"', '?hd=1?hd=1');
$replace = array('?hd=1&wmode=transparent" frameborder="0"', '?hd=1');
$html = str_replace($search, $replace, $html);
return $html;
} else {
return $html;
}
}
add_filter('the_content', 'add_video_wmode_transparent', 10, 3);

Responses (1)
Support Kangaroo (joined March 2011) Likes (0)
Greetings ebrown,
Thank you for this great solution and for sharing it with other WPMU Dev Members.
Some rep points coming your way.
Cheers, Joe
Become a member