html: Validating the Tweetmeme Wordpress Plugin
We recently installed the Tweetmeme Wordpress plugin, only to find that it threw over a dozen errors our way that invalidated our XHTML Strict code. It’s far too valuable a plugin to leave off of any good blog, but we do want to be sure that the code doesn’t throw errors. Here’s how to fix those under five minutes.
1. Replace & with & where necessary.
The list should be: &source, &style, &service, &service_api, &force
You can simply do a find and replace for each of these with your & equivalent.
2. Change “iframes” to “objects”
For this, you can simply copy and paste our code:
FIND:
<iframe scrolling="no" height="105" frameborder="0" width="200" src="http://api.tweetmeme.com/chart.js?url=<?php echo urlencode(get_permalink($post->ID)); ?>&chs=200x100&force=true">
REPLACE WITH:
<object type="text/html" data="http://api.tweetmeme.com/chart.js?url=<?php echo urlencode(get_permalink($post->ID)); ?>&chs=200x100&force=true" style="height:105px;width:200px;border:0;overflow:hidden">
FIND:
<iframe src="http://api.tweetmeme.com/button.js?url=' . urlencode($url);
REPLACE WITH:
<object type="text/html" style="overflow:hidden" data="http://api.tweetmeme.com/button.js?url=' . urlencode($url);
FIND:
$button .= ' frameborder="0" scrolling="no"></iframe>
REPLACE WITH:
$button .= ' ></object>
FIND:
target="_blank"
REPLACE WITH:
target="_parent"
That’s it! That wasn’t so bad now was it? Please let us know in the comments if you run into any issues.
Tags: replace iframe with object, tweetmeme, tweetmeme plugin, twitter, wordpress plugin, xhtml strict






August 7th, 2009 at 6:42 pm
Thank you. That works great.
August 7th, 2009 at 7:12 pm
Glad we could help Andrew!
November 10th, 2009 at 6:02 pm
I spotted this fix, but noticed your site has the same problem as mine again now, using iframe and src etc.
I'm using 2.8.5 and 1.7.1 for the plugin…
Do I disable it because invalid code on a blog offering website advice looks really naff- or spend time fixing it, or disable something that brings me traffic…. decisions decisions….
November 10th, 2009 at 6:19 pm
Hi @thinklikeauser!
It looks like we must have inadvertently "automatically upgraded" the plugin. Thankfully we have a backup, and we will look into recreating the fix for the latest version of the plugin.
Thanks for letting us know!
February 15th, 2010 at 3:38 am
Good post and this post helped me alot in my college assignement. Say thank you you for your information.
April 27th, 2010 at 11:21 am
Assuming that they don't fix this on their own, yes unfortunately. I would suggest looking at the change log to see whether it's worth upgrading before going through the process. Thanks for your question!