How to Install the Google +1 Button in WordPress
Posted: January 28, 2013 by Alex Chan
The Google +1 Button is similar to the Facebook Like Button. Getting +1'd is a proven way to increase your search engine visibility and your search engine traffic. We're going to use a similar implementation method to the one we used in our How to Install The Facebook Like Button in WordPress post.
Google +1 Button Widget
1. Visit Google's +1 Button API page
2. Configured The Design of your Google +1 Button
Using the form, you can change the style of your Google +1 widget. Choose the style, version, and more. Fill in the form with the settings you like and put a hash(#) or anything into the URL field. We will change that to the dynamic WordPress URL.
- Make sure asynchronous is selected
There are a number of hidden features Google never put into their form. The version we use on the website uses the "Tall" version which doesn't appear in the options. Here's the version we're using:
3. Copy The Google +1 Button Code to your template
Follow the instructions in the code and paste it into your template with your favorite editor. For the bottom section "<!– Place this tag after the last +1 button tag. –>", paste that right above the <body> tag.
4. Set data-href="<?php the_permalink(); ?>"
Change the dummy URL you used for the generated code with <?php the_permalink(); ?>. This step isn't necessary but it's the best way to pass the link you want +1'd to Google. It's recommended you add this step in.
5. Upload the files to your server
Congratulations! Your Google +1 Button widget is all setup.