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
-
http://sharethis.com Jen Parga
-
http://www.saphod.net Marco
Similar Posts
Visitors to this post also read
Categories
- Around The Web (76)
- Cinema/DVD/TV (22)
- Down Under (14)
- Firefox/Thunderbird (27)
- Fun Stuff (44)
- Gaming Stuff (12)
- Miscellaneous Stuff (59)
- Music Stuff (34)
- News Stuff (12)
- Personal Stuff (56)
- WordPress Stuff (130)
Archives
- January 2011 (1)
- December 2010 (7)
- November 2010 (2)
- September 2010 (4)
- 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)
Recent Comments (including Ping-/Trackbacks)
- jhon marshal on Shopping In Down Under
"Also compare prices here at: http://www.shopprice.com.au…" - Thomas Spear on How To Add Ping-/Trackbacks When Using Disqus
"I received your link from the Scottsdale Computing blog post. As Disqus now no l…" - Hector Galarza on Handling MySQL Errors Using The $wpdb Class
"I know this is and old post but I don't exactly understand what you are trying t…" - Display Pingbacks on WordPress Posts with Disqus Comment System - Scottsdale Computing on How To Add Ping-/Trackbacks When Using Disqus
"[...] of this code is taken from here: http://www.saphod.net/2010/07/09/how-to-a…" - Getting pingbacks & trackbacks working with Disqus & WordPress | Fublo Ltd blog on How To Add Ping-/Trackbacks When Using Disqus
"[...] Use this great code snip from Marco Luthe to show pingbacks on posts. [..…"
Most commented
Recent Articles
Tag Cloud
addon ajax Australia blogging cinema comic comments css dvd edition email extension firefox flickr freeware fun gmail google googlemail hannover image javascript journey limited melbourne movie music photo picture plugin R.E.M. release rss song spam Spider-Man theme troubleshooting update variant video watch webdesign wordpress youtubeCover WP Theme by One Designs (slightly altered)
© 2006 - 2013 Marco Luthe Online! | Web Imprint | Privacy Policy











