Embed PicasaWeb Album in WordPress, XHTML 1.0 Compatible

It’s quite convenient that Google PicasaWeb released the new feature of embedding album by flash. But the same as some other places in PicasaWeb, the codes it gives out aren’t XHTML 1.0 compatible, either…

Though it’s not a big deal and I know someone thinks w3c standards stupid, I would like my own blog in clean and tidy codes, and I wish there are some more strict standards in HTML world, that will make programmers life much easier and make Internet more organized.

The more realistic problem, which drove me to do some experiments and write down this post, is that WordPress is actually quite picky with html codes. If you use PicasaWeb’s codes in WordPress, wich use “embed” tag, WordPress will change it to “ibed” tag automatically. That will lead to some annoying small bugs when you want to edit the post or switch between “Visual” and “Code” modes. So I guess I’d better feed WordPress, this picky girl, some W3C compatible codes.

Finally I chose the plugin pb-embedFlash to do that. For example, PicasWeb gives me such codes for embedding one of my albums

<embed type=”application/x-shockwave-flash”
src=”http://picasaweb.google.com/s/c/bin/slideshow.swf”
width=”400″ height=”267″
flashvars=”host=picasaweb.google.com&captions=1&RGB=0x000000&
feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F
weiwei9%2Falbumid%2F5084619049582967009%3Fkind%3Dphoto%26alt%3Drss”
pluginspage=”http://www.macromedia.com/go/getflashplayer”></embed>

Then with pb-embedFlash, what I need to do is just use codes like this

[ flash http://picasaweb.google.com/s/c/bin/slideshow.swf?
host=picasaweb.google.com&captions=1&RGB=0x000000&
feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F
weiwei9%2Falbumid%2F5084619049582967009%3Fkind%3Dphoto%26alt%3Drss w=400 h=267]

Use the swf URL followed by a question mark and the value of flashvars in codes given by PicasaWeb. Note that I leave a blank space between the “[” and “flash” to avoid being converted.

I have to admit it’s not an easy job to insert some Flash in WordPress without plugins, so I strongly suggest the plugin – pb-embedFlash.

Leave a Reply