The code you specified generates the AddThis button linked to the current post id.
You might need to use a variation of the above code in your template to show the AddThis buttons linked to the URL (of the archive) of your choice.
do_action('addthis_widget', [permalink to the archive page], [title of the archive page], 'fb_tw_p1_sc');
Thanks Kiran, I’ve got a little closer. using the following:
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
do_action('addthis_widget',$current_url, the_title_attribute('echo=0'), 'fb_tw_p1_sc');
Produces this in the page:
<div class="addthis_toolbox addthis_default_style " addthis:url="The Taxonomy Archive URL" add this:title="The title of the last post" >
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
The Title is wrong but I expect I can get this filtering wp_title. There is nothing in the A tags however so it doesn’t look like this is going to work whether the title is correct or not.
wp_title('','0')
corrected the title. A tags still empty.
The answer turned out to be simple – the Addthis javascript needed to be added:
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
Hi,
Nice to hear that the issue is resolved for you.
By the way, to get the latest version of AddThis UI, you can use 300 instead of 250, in case you are not aware of this.
<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js"></script>