Add Facebook, Twitter, Linkedin, Google+ & Pinterest Buttons to WordPress
Ok, you can probably do this easy with a plugin but I’ve over 50 active plugins on this site and it feels like an awful lot sometimes and can it affect the perforamce of my site. You can accomplish a lot of the tasks plugins achieve by using manual code in your template files and it gives you a bit more control over styling, position etc.. Among the easiest things to code into templates are Social Sharing buttons to allow people to share your posts on the big gun Social Networking sites like Facebook, Twitter, Linkedin and now Google+.
I’ll cut to the chase and give you the simple code below. All of these go into the “single.php” file most of the time at a position of your choosing either above or below the content:
Facebook Like Button
<iframe style="border: none; overflow: hidden; width: 95px; height: 21px;" src="http://www.facebook.com/plugins/like.php?app_id=142128822547792&href=<?php echo urlencode(get_permalink($post->ID)); ?>&send=false&layout=button_count&width=95&show_faces=false&action=like&colorscheme=dark&font&height=21" frameborder="0" scrolling="no" width="320" height="240"></iframe>
Get your own Facebook app id from within your own account and plug it in above instead of mine. You can edit some of the parameters above too like width, height, colours, etc..
Tweet Button
<a type="text/javascript" href="http://twitter.com/share" data-count="horizontal" data-via="reverbstudios">
Put your own Twitter username in the ‘data-via’ parameter instead of mine.
Linkedin Share Button
<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script><script type="in/share" data-url="<?php the_permalink(); ?>" data-counter="right"></script>
Google+1 Button
<g:plusone size="standard" href="<?php the_permalink(); ?>"></g:plusone>
And put this in your theme’s ‘footer.php’ file just above the closing






















