How to add hashtag to custom AddThis Twitter button image

How to add hashtag to custom AddThis Twitter button image

Addthis is a good solution for sharing social icons. It tracks the number of shares and it comes with a free version. In the solution below I opted to go with a manual implementation as opposed to using the WordPress plugin. This will help your site speed and is generally good to avoid plugins as much as possible. For using the custom AddThis code you will need to create an account and generate your code from there.

Custom AddThis Twitter button Image

Here’s the final custom button widget sample.

AddThis Share

How to add hashtag to custom AddThis Twitter button image

How to add hashtag to custom AddThis Twitter button

Here’s the code responsible for the the #Custom hashtag on a Addthis button.

	<a class="addthis_button_twitter" addthis:title="<?php wp_title('|', true, 'right'); ?> #Custom"></a>

The complete AddThis code

Go to www.addthis.com/dashboard to customize your tools and don’t forget to add your custom image in the images folder in your theme.


<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=YOUR-ID-HERE" async="async"></script>




<div class="addthis_toolbox social-share">

	<span class="share-title">SHARE ON</span>


<div class="custom-images">
	
	<a class="addthis_button_twitter" addthis:title="<?php wp_title('|', true, 'right'); ?> #Custom"><img src="<?php bloginfo('template_directory') ;?>/images/twitter.png" width="24" height="" border="0" alt="Share to Twitter" /></a>
	
	</div>


</div>





 

Comments are closed.