How To Automatically add Twitter and Facebook buttons to your posts


Sponsored Links




How To Automatically add Twitter and Facebook buttons to your posts, this trick original created by Dev7Studios and I will share it again for you.

Twitter and Facebook

Twitter and Facebook

Like on many many WP Tutorials that I was write on WP Tricks, you need to put this code on functions.php on your current theme

function share_please($content){
    if(!is_feed() && !is_home()) {
        $content .= '<div class="share-this">
                    <a href="http://twitter.com/share&quot;
class="twitter-share-button"
data-count="horizontal">Tweet</a>
                    <script type="text/javascript"
src="http://platform.twitter.com/widgets.js"></script&gt;
                    <div class="facebook-share-button">
                        <iframe
src="http://www.facebook.com/plugins/like.php?href='.
urlencode(get_permalink($post->ID))
.'&amp;layout=button_count&amp;show_faces=false&amp;width=200&amp;action=like&amp;colorscheme=light&amp;height=21"
scrolling="no" frameborder="0" style="border:none;
overflow:hidden; width:200px; height:21px;"
allowTransparency="true"></iframe>
                    </div>
                </div>';
    }
    return $content;
}
add_action('the_content', 'share_please');

Using This method is the most easiest and simple way to promote our post into Facebook and Twitter.

Now with this tricks we can easily add Twitter and Facebook buttons to the bottom of your posts. And the code will be put automatically.

Photos source http://www.flickr.com/photos/wyrdo/3753428652/

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

Automatically add Twitter and Facebook buttons to your posts

Nowadays, most bloggers are using Facebook and Twitter to promote their posts. In today’s recipe, I’m going to show you how you can easily add Twitter and Read More

Automatically add Twitter and Facebook buttons to your posts

This code snippet shows you how to automatically add super cool Twitter and Facebook "Share" buttons to your posts. Read More

WordPress hook: Automatically add a Google+ button to your posts

I was trying to think of the best way to call all three at the same time. http://www.wprecipes.com/automatically-add-twitter-and-facebook-buttons-to-your-posts Read More

Twitter / Twitter buttons

Twitter Buttons. Add buttons to your website to help your visitors share content and connect with you on Twitter. Read More

WordPress › 1-click Retweet/Share/Like « WordPress Plugins

buttons on your blog posts: Google +1; Facebook Like; Facebook Share; Twitter button you to Automatically Publish or Self Publish your Blog Posts to 30+ Networks. Facebook Read More


One Response to How To Automatically add Twitter and Facebook buttons to your posts

  1. Pingback: Tweets that mention How To Automatically add Twitter and Facebook buttons to your posts # WordPress Tricks & Tips -- Topsy.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>