Add Google's +1 button to Wordpress Site


Google's +1 has been implemented and all Googler's can see this button on each and every link of the google search.Google's +1 is the a competitive button for Facebook's Like button.


Well, the question is how to add this new feature of Google +1 to Wordpress site?


Add the following script code to footer.php file before the </body> tag.


[stextbox id="grey"]<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>[/stextbox]

Now, open up your single.php file and add anyone of the following code snippet which you wish to show this Google's +1 button.



//Code for Tall Button [stextbox id="grey"]<g:plusone size="tall" href="<?php the_permalink(); ?>"></g:plusone>[/stextbox]

//Code for Standard button [stextbox id="grey"]<g:plusone href="<?php the_permalink(); ?>"></g:plusone>[/stextbox]

//Code for Medium Button [stextbox id="grey"]<g:plusone size="medium" href="<?php the_permalink(); ?>"></g:plusone>[/stextbox]

//Code for Small Button [stextbox id="grey"]<g:plusone size="small" href="<?php the_permalink(); ?>"></g:plusone>[/stextbox]

If you do not want count of the Button to show, then you can use the following code. [stextbox id="grey"]<g:plusone size="medium" count="false" href="<?php the_permalink(); ?>"></g:plusone>[/stextbox]