Steps:
- Login to Deshboard
- Go Appearence to Editor
- Select “functions.php” of your theme
/*-----------------------------------------------------------------------------------*/ /* Social Buttons /*-----------------------------------------------------------------------------------*/ add_action('the_content', 'social_buttons'); function social_buttons($content){ if(!is_feed() && !is_home()) { $social .= '<div class="share-this"> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <div class="plusone"><g:plusone size="medium" annotation="inline" href="'.get_permalink().'"></g:plusone></div> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a> <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> <div class="facebook-share-button"> <iframe src="http://www.facebook.com/plugins/like.php?href='.urlencode(get_permalink(get_the_ID())).'&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" style="border:none; overflow:hidden; width:450px; height:60px"></iframe> </div> </div>'; } return $social . $content; }
To use buttons under the post or page use the following
/*-----------------------------------------------------------------------------------*/ /* Social Buttons /*-----------------------------------------------------------------------------------*/ add_action('the_content', 'social_buttons'); function social_buttons($content){ if(!is_feed() && !is_home()) { $social .= '<div class="share-this"> <table border="0" width="100%"> <tr> <td style="border-width: 0px;"> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a> <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> </td> <td style="border-width: 0px;"> <iframe src="http://www.facebook.com/plugins/like.php?href='.urlencode(get_permalink(get_the_ID())).'&send=false&layout=button_count&width=450&show_faces=true&action=like&colorscheme=light&font&height=21&scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe> </td> <td style="border-width: 0px;"> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <div class="plusone"><g:plusone size="medium" annotation="inline" href="'.get_permalink().'"></g:plusone></div> </td> </tr> </table> </div>'; } return $social . $content; }
To use side by side after a post or page use the following
/*-----------------------------------------------------------------------------------*/ /* Social Buttons /*-----------------------------------------------------------------------------------*/ add_action('the_content', 'social_buttons'); function social_buttons($content){ if(!is_feed() && !is_home()) { $social .= '<div> <table border="0" width="100%"> <tr> <td style="border-width: 0px;"> <a href="http://twitter.com/share" data-count="horizontal">Tweet</a> <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> </td> <td style="border-width: 0px;"> <iframe src="http://www.facebook.com/plugins/like.php?href='.urlencode(get_permalink(get_the_ID())).'&send=false&layout=button_count&width=450&show_faces=true&action=like&colorscheme=light&font&height=21&scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe> </td> <td style="border-width: 0px;"> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <div><g:plusone size="medium" annotation="inline" href="'.get_permalink().'"></g:plusone></div> </td> </tr> </table> </div>'; } return $content . $social; }
After paste the code Click on “Update File”. That's all about this post.
0 Comments Received
Leave A Reply