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.



