Taming Wordpress' Share And Follow Plugin
If you happen to be a bit geeky about your pages being web standards compliant, you may be interested in this article. It's not (really) to do with Accessibility, but opening a new category was paying that little typo too much attention, I thought.
It's actually nothing really; a lot of your visitors won't even recognise the difference — but, you know, either you are into standards or you aren't, right?
So what's the story? If you happen to run a so far standard-compliant Wordpress-based website, you might be frustrated by the HTML-Validator suddenly throwing errors at you, without you having done anything to deserve the shame. It cannot be: You worked for hours (or even days, perhaps), keeping your source code tidy, and now this.
If all you have done was installing the “Share And Follow” Plugin, the solution is near. The little bugger hides in the “Setup share image” section of the plugin. (In the backend: Settings > Share And Follow) There, you have the option to “Add the share image metadata to the head section of your web pages”. What it does is actually adding a reference to your “Gravatar” (Globally Recognised Avatar, if you have one) within the metadata section of your web pages. What it also does is having your pages instantly falling from standard; there is a tiny typo in the responsible function.
What you can do about it is simply adding four characters to the file in question. Walk down the file path until you get to: http://your-domain.tld/wordpress/wp-content/plugins/share-and-follow/functions.php (or so). Open this file with your ASCII text editor (not the one from your office suite), and go to line 363. There you will read: “&size=” . $size;, change it to “&size=” . $size;. If you can't find this line, look up the term “gravatar” (Ctrl-F), it's towards the end of the file. Done.
What's happened? The web standard requires special characters in URLs to be masked. If they aren't, the validator throws errors. If you haven't been into this stuff a lot yet: The ampersand (&) is used to add parameters to dynamic URLs. In the address line of your browser, it will always look like this: &, but in your source code, it needs to be written like so: &
03.05.2010. 10:29
Comments
Oh Gerry,
you may be interested to know that I have upgraded the Share URL option with a post/page level over-ride.
If you want to use this, just go into a page or post. If you then add a custom field called “image_src” and then put in the value field the URL of the share image you want.
It's in release 1.18.6 going out today...
Regards, Andy
Hey Gerry,
it should definitely be fixed now. Do let me know if you have any more issues though.
All the best, Andy
Andy, thanks for your comment. Do you mind leaving another comment here when you are finished?
Hey thanks for this...
I was trawling through looking at who's saying what about the plugin and found this.
I'll fix it in a release very soon.
Also the plugin does not only do Gravatar, but also does a choice of user defined images for different styles of wordpress page (post/page/homepage/archive).
So for example on the homepage when there is more than 1 author, you can have a site logo, default gravatar image or a predefined separate image that just relates to the home page.
I might look at adding a separate image set up for categories also, but have not thought about the logic for it yet.
All the best, Andy
share and follow
Categories
RSS Feeds
Blog Roll
New Posts
New Comments
House Rule
I may not approve of what you say, but to my death I shall defend your right to say it.
(Evelyn Beatrice Hall)








Write a comment
* = required field