Posted by Dave on

Add This

Add This

I created this page to test scripts published by http://addthis.com. It was originally created on the Qube. See below for early experiments for what I wrote at the time, all probably useless now. I have installed their wordpress widget and so even lower down on this page, after the article , are add this’s sharing buttons. I suppressed the plugin on my blogs some time ago, but Addthis exposed itself again when I implemented the Cronus theme in 2021.  ….

WordPress Integration

Here are some notes in my early implementation, it’s not much use today as the plugin seems to handle it.

In March 2014, I installed the wordpress addthis plugin. Addthis’ wordpress plugin has several automatic display widgets, I have turned these off and use custom settings implemented as php in my child theme directory. This has involved amending single.php and index.php. Single.php code comes from the addthis site, the code in index.php is custom. The index page has a single badge with the share sites behind it. The code is;

  
<a style="text-align: right; float: right; margin-right: 4px;" title="Share with add this"></a>

The code on single.php comes from the addthis site.

     <!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
     <a class="addthis_button_facebook"></a>
     <a class="addthis_button_twitter"></a>
     <a class="addthis_button_google_plusone_share"></a>
     <a class="addthis_button_delicious"></a>
     <a class="addthis_button_email"></a>
     <a class="addthis_button_print"></a>
     <a class="addthis_button_compact"></a>
</div>

Early Experiments

The add this code, used to look like this, where the target was an owned HTML site…

<!-- AddThis Button BEGIN -->
<SCRIPT TYPE="text/javascript">
    addthis_pub  = 'davelevy';
    addthis_options  =  'favorites, email, delicious, twitter, google, technorati, more';
</SCRIPT>

<A HREF="http://www.addthis.com/bookmark.php"
 ONMOUSEOVER="return addthis_open(this, '', '[URL]', '[TITLE]')"
 ONMOUSEOUT="addthis_close()" ONCLICK="return addthis_sendto()"><IMG
SRC="http://s9.addthis.com/button1-share.gif" WIDTH="125" HEIGHT="16"
BORDER="0" ALT="" TITLE="share this"></A> 

<SCRIPT TYPE="text/javascript" SRC="http://s7.addthis.com/js/152/addthis_widget.js" TITLE="share this"></SCRIPT>

<!-- ADDTHIS BUTTON END -->

The URL & TITLE are only required if not the values of the current page. I have example code working on my static pages, see http://davelevy.info. The addthis site docuents the script parameters at this support page.

I looked into comparing this with sharethis, but can’t find my notes.

The code above implements as this,

Well, maybe not, something isn’t working right. 24 Jul 2013

This was originally published on my snipsnap bliki, it was renamed as Add This when copied on 20th June 2013. There looks like some snipsnap specific implementation syntax has been copied. I know that the URL and TITLE need to be set.

I found the following comments on the Bliki’s test page 3.

To get this to work, I removed the comments which didn’t seem to work and removed the two variable definitions by inserting text values. I am not sure if this is a mandatory feature of the script, or if snipsnap is barfing over the use of [. I have hard coded the URL into this html string, and the RSS feed which required me to remove the comments, it seems that snipsnap is not keen on the –> and gets it wrong. even inside the {html} macro. 27 July 2013


Comments ( 6 )

  1. Developing Snipsnap | wiki.davelevy.info
    [...] as appropriate, but I am having difficulty with the http://addthis.com buttons. See Test Page and Share This pages on this [...]
  2. Share This | wiki.davelevy.info
    [...] my Add This [...]
  3. Installed Plugins | wiki.davelevy.info
    […] Version 3.5.9 | By The AddThis Team | Visit plugin site See also my Add This page. […]
  4. ReplyAuthorDave
    I implemented add this on this wiki over the last couple of days. I changed the page to reflect the changes made in March 2014. The 2008 stuff I have left on the main page. Perhaps I'll relegate it to a comment next time I visit the page.
  5. ReplyAuthorDave
    I have implemented this on the blog now, I need to work out how to control the options on the index page and need to add favourites to all options. I also need to get on top of the CSS.
  6. ReplyAuthorDave
    I last touched this in 2014 and add this popped up in a new theme. I need to think as to whether I keep it or not. I did decide that it was not well used and so looked sad and took space. I have marked the article as 'deprecated' and need to consider removing/retiring much of the code as the plugin is much more robust today.

This site uses Akismet to reduce spam. Learn how your comment data is processed.