Video Post 3: Fourthcoming Events in NovemberArtificial Intelligence - NOT in Games

# XHTML Valid YouTube Videos in WordPress

technological @ 10 November 2007

Right! YouTube doesn’t provide you with XHTML 1.0 valid tags for you to place in your website/blog, not sure why because all modern browsers that are capable of playing YouTube videos are capable of reading the <object> tag correctly.

However, after attempting to use some XHTML valid versions that I found on the web they just didn’t work - they tended to break my wordpress theme. So I came up with my own which does work, feel free to use it:

<object type="application/x-shockwave-flash" data="https://www.youtube.com/v/9buuv8pHvUw" width="425" height="350"><param name="movie" value="https://www.youtube.com/v/9buuv8pHvUw" /></object>

The key thing here is that when entering it into the code section of your WordPress:Write Post you must not separate the code with whitespace - as its likely to automatically add <p> tags.

Hope it helps :-)

Technorati Tags: wordpress, youtube, xhtml

One Response to “XHTML Valid YouTube Videos in WordPress”

  1. music Says:

    very interesting.
    i’m adding in RSS Reader

Leave a Reply