Daniel Lewis

A personal, spiritual, academic, technological and business blog.

XHTML Valid YouTube Videos in WordPress

November 10th, 2007 by daniel

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

Categories: technologicalNo Comments

Leave A Comment

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.