Pages

Sunday, August 12, 2012

How to Add Google+ “Add to Circles” Badge in your WordPress Site

Recently, one of our users asked us how they can add the Google+ “Add to Circles” Badge in their WordPress site. In the past, we have shown you how to add the Google +1 Button your WordPress Posts. In this article, we will show you how to add the Google+ “Add to Circles” Badge in your WordPress site.


Preview of how a Google+ Badge looks like:


Google+ Add to Circles Badge


Before we begin, you should note that this is only for Google+ Pages not profiles. Example of Google+ Page. Example of Google+ Profile.


First thing you need to do is put the following code in your <head> section of your site which you can modify by editing the header.php file of your theme.



<link href="https://plus.google.com/{plusPageID}" rel="publisher" /><script type="text/javascript">
(function()
{var po = document.createElement("script");
po.type = "text/javascript"; po.async = true;po.src = "https://apis.google.com/js/plusone.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(po, s);
})();</script>

Don’t forget to replace the {plusPageID} with your Google+ Page ID. Your Page ID is a 21-digit string at the end of the URL. For example if your page URL is: https://plus.google.com/101634180904808003404/ then the numbers in bold is your Page ID.


Once you have added the header code, then all you have to do is place the following code wherever you want the Google+ Add to Circles widget to show. Most users like to display this in their sidebar, so you can either modify your sidebar.php file, or simply add it in a text widget area.



<g:plus href="https://plus.google.com/{plusPageID}" size="badge"></g:plus>

For the Small badge, simply use this code:



<g:plus href="https://plus.google.com/101634180904808003404" size="smallbadge"></g:plus>

We hope that this article has helped you. If it did, then please consider adding WPBeginner in your Circle.


How to Add Google+ “Add to Circles” Badge in your WordPress Site is a post from: WPBeginner which is not allowed to be copied on other sites.







via WPBeginner http://www.wpbeginner.com/wp-tutorials/how-to-add-google-add-to-circles-badge-in-your-wordpress-site/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+wpbeginner+%28WordPress+for+Beginners%29