Marco Luthe Online! » WordPress Stuff » ShareThis.com And Plugin Trouble
ShareThis.com And Plugin Trouble
November 16th, 2007 | View Comments
I stumbled upon ShareThis.com accidently on a blog when I was kind of randomly surfing the web, looking for blog designs. The “ShareThis” button really caught my attention: one click on the button opens a new container with several social bookmarking services where you can add the URL of the current post you view. You can even send the URL via mail or instant messenger – that way, I could get rid of one more plugin (WP-EMail).Up to that point, I was still using the WordPress plugin Social Bookmarks, but I did not quite like the way all icons where shown – it was kind of “too much”.
The way ShareThis handles this is – in my opinion – much more elegant and eye-catching.
As I am using WordPress (surprise!), the question “Looking for ShareThis WordPress plugin?” made me click, download and install the plugin (version 2.0) which was released by Alex King.
Well, what can I say?
There are still some improvements to make on this one, because…
- … the code that is produced by the plugin is not XHMTL valid.
The reason for that is that ampersands are not integrated as HTML entities (& + amp;) – which is a breach of validation rules. One must mention that the JavaScript code is provided by ShareThis itself and has to be copied into a (much too small) textarea field within the WordPress options panel. Nevertheless, I was unable to change the ampersands within that textarea field – a “&publisher=” was always added at the end of the string – I guess that has something to do with the RegEx. Each time after I had entered the options panel, several “&publisher=” were added to that code which all were identical. So, to get the code right, I actually had to change it in the wp_options table – and remember not to visit the options panel again. - … the plugin messes with the Slickr Gallery plugin.
I found this out by accident, because after installing the ShareThis plugin, I looked at several posts and pages of my blog to see if everything goes well – it didn’t: Slickr Gallery was not presenting my flickr photos on my photos page within Firefox any longer, it was stuck within the loading progress. Firebug told me there was a problem with the JavaScript. Somehow, embedding the JavaScript by the ShareThis plugin in each page seems to have messed things up. - … the button is added everywhere.
By default, the “ShareThis” button is shown everywhere – in posts as well as in excerpts (and I believe in RSS feeds as well). Options are not available to control this behaviour. You manually have to comment out the “add_action” parts in the core plugin file to get rid of this.
As can be seen, I am not that convinced of this plugin by now.
Sorry for this, Alex – but I still like your Popularity Contest plugin very much.
[Update from 2007-11-17]
OK, I managed to include ShareThis into my template without the plugin.
First of all, be sure to include the JavaScript code provided by ShareThis into the header template. I do this after finding out if the main page or a single post is viewed. Otherwise, no code will be included. This way I can prevent it from messing up the Slickr code on the photos page.
(...)
<?php if(is_home() || is_single()) { ?>
... put the JavaScript code provided by ShareThis here ...
<?php } ?>
<?php wp_head(); ?>
(...)
Then, within The Loop, put this JavaScript wherever you want the button to appear (this is actually taken from the plugin mentioned above):
<?php
global $post;
$sharethis = '
<script type="text/javascript">
SHARETHIS.addEntry({
title: "'.str_replace('"', '\"', get_the_title()).'",
url: "'.get_permalink($post->ID).'"
});
</script>';
echo $sharethis;
?>
This should work fine now.
[Update from 2007-11-25]
Hmm… the ShareThis plugin does not seem to be the only one messing around with the Slickr Gallery plugin.
[Update from 2008-04-14]
I decided to get rid of the ShareThis button, as I want to minimize embedding external scripts. The Digg-button and “add to del.icio.us” should be sufficient for social bookmarking. It does not make any sense to have 20 different services shown.
Filed under: WordPress Stuff · Tags: plugin, sharethis, social bookmarking, troubleshooting, wordpress
-
Marco
-
Jen Parga
Similar Posts
Visitors to this post also read
Categories
- Around The Web (76)
- Cinema/DVD/TV (21)
- Firefox/Thunderbird (27)
- Fun Stuff (44)
- Gaming Stuff (12)
- Miscellaneous Stuff (55)
- Music Stuff (33)
- News Stuff (12)
- Personal Stuff (55)
- WordPress Stuff (126)
Archives
- July 2010 (4)
- June 2010 (4)
- May 2010 (2)
- April 2010 (1)
- March 2010 (1)
- September 2009 (1)
- July 2009 (1)
- June 2009 (2)
- May 2009 (1)
- April 2009 (1)
- March 2009 (2)
- February 2009 (2)
- January 2009 (8)
- December 2008 (10)
- November 2008 (9)
- October 2008 (9)
Recent Comments (including Ping-/Trackbacks)
- Marco on How To Add Ping-/Trackbacks When Using Disqus
"Hey guys, it seems they have published a new version of the Disqus plugin which …" - James on How To Add Ping-/Trackbacks When Using Disqus
"Hi Marco - the post on fublo.net i…" - Marco on How To Add Ping-/Trackbacks When Using Disqus
"Thanks for the mentioning. I turned off trackbacks for Disqus now, also, but I t…" - James on How To Add Ping-/Trackbacks When Using Disqus
"Hi Marco, thanks for this code snip. I've extended some of the formatting us…" - Marco on How To Add Ping-/Trackbacks When Using Disqus
"Hi Chris,thanks for your feedback, I am glad the code works.I th…"











