How to Add Google +1 Button to Your WordPress Website
Written by: Eileen Lonergan
If you would like to embed the +1 in your blog, you may use the Google +1 plugin, go to Google Webmaster Tools, or use this code inside your themes functions.php file:
/* Add plusone.js to section of your theme */
add_action (‘wp_enqueue_scripts’,'google_plusone_script’);
function google_plusone_script() {
wp_enqueue_script(‘google_plus_one’, ‘https://apis.google.com/js/plusone.js’, array(), null);
}
/* Add +one button after your post content by using filter */
add_filter(‘the_content’, ‘google_plus_one’);
function google_plus_one($content) {
$content = $content.’
‘;
return $content;
}
?>
You can style and align button in post text by applying following class
Add this code in your theme’s style.css if you want to align it to left:
.google_plus_one{
display: inline;
float: left;
margin-right: 20px;
margin-top: 4px;
}
And add this code in your theme’s style.css if you want to align it to right side:
.google_plus_one{
display: inline;
float: right;
margin-left: 20px;
margin-top: 4px;
}
It’s all about +1 this week, Google’s new sharing tool. According to Google +1 is:
The +1 button is shorthand for “this is pretty cool” or “you should check this out.”
Click +1 to publicly give something your stamp of approval. Your +1′s can help friends, contacts, and others on the web find the best stuff when they search.
If you want to enable +1, click here and you will see the massive Try Now button, a simple click and you will be all set.

