Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
This is a very simple code snippet to add social button as sortcode in wordpress
// paste this section in your functions.php
function j_add_this_social() {
return '<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit" pi:pinit:layout="horizontal"></a>
<a class="addthis_counter addthis_pill_style"></a>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="//"></script>';
add_shortcode('j_add_this_social', 'j_add_this_social');
//end addthis section
// use this sortcode in your page/post/sidebar
// [j_add_this_social]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment