• Resolved johanna2patricia

    (@johanna2patricia)


    Hi everybody,
    I added a link to a Youtube video on my site. Just by adding the Youtube link. That works great.
    The only thing is, it isn’t W3C valid.
    “The frameborder attribute on the iframe element is obsolete. Use CSS instead.”
    What file contains the frameborder code?

    Johanna

Viewing 1 replies (of 1 total)
  • Thread Starter johanna2patricia

    (@johanna2patricia)

    Ok found the solution.
    Put this in the functions.php of your child theme:

    /*
    |-----------------------------------------------------------------------
    | Sky oEmbed Filter by Matt - www.skyminds.net
    |-----------------------------------------------------------------------
    |
    | The sky_oembed_filter() function attempts to validate WordPress
    | video oEmbeds for HTML5.
    | $return is the normal HTML that the oEmbed process would return.
    | $data is the data received from the oEmbed call, in an object format.
    | $url is the original URL being queried for oEmbed info.
    |
    */
    function sky_oembed_filter( $return, $data, $url ) {
     	$return = str_replace('frameborder="0" allowfullscreen', 'style="border: none"', $return);
    	return $return;
    }
    add_filter('oembed_dataparse', 'sky_oembed_filter', 90, 3 );
    ?>

    Johanna ??

Viewing 1 replies (of 1 total)
  • The topic ‘Video embed not valid – where do I find the code?’ is closed to new replies.