Google Plus One ( 1) Plugin (w3c validator neutral)
-
Hi!
while using some google plus one plugins from the plugin browser i got a lot of validation warnings from w3c’s validator. To make it short: I don’t like warnings and i wanted my site to be 100% valid XHTML code. So i created a plugin of my own – but: I’m too lazy to go through all the plugin registration stuff – however maybe someone will find this useful. Here is the complete code of the plugin. Despite the bits that are required to be GPLv3 because of the wordpress licence i’m giving it to you as public domain. Use it well!
[Code moderated as per the Forum Rules. Please use the pastebin]
Oh right, this it what it does:
– Adds an empty <div> with the post id to each post.
– Buffers the post ids
– Places a javascript piece at the end that replaces the divs with the Google PlusOne code
– Google does the rest for youValidators don’t execute javascript, so it will only see an empty div-tag which is XHTML strict compatible.
… and if you like it… put some cheers in this thread so i can return here and be happy ??
konqi
- The topic ‘Google Plus One ( 1) Plugin (w3c validator neutral)’ is closed to new replies.