Google recently launched their own take on Facebook’s Like button called the +1 button. The idea is to “+1” sites that you like or found useful so that your friends (and Google) get a good idea of where the best content is.
You will then see pages that your contacts have “+1’d” in your search results, so you can get a good feel for what information your friends have found useful.
Open up footer.php and find the closing body tag. Then paste the following in the line just above it, like so:
Save your changes and move on to tell WordPress where to display the button.
Step 2: Decide where to put it
You have a few different options for where your +1 button can go, but I’m going to show you the two main options; in your sidebar or in each individual post.
Put it in the sidebar
Putting it in the sidebar is certainly easier and less dangerous if coding scares you. All you need to do is create a new text widget and paste the following into it:
That’s it! Save your changes, refresh your homepage and check out your new +1 button. You can of course add styling (alignment, margins etc.) as your site design requires.
Put it in individual posts
Placing it in individual posts involves a tad more coding, but is still ridiculously easy. Open up your single.php file and decide where you want to put the +1 button (before your post, after it etc.). Once you’ve settled on a location, paste the following code where you want it to appear:
The reason this looks slightly different is because we’re specifying the URL that should receive the +1 (the page’s permalink). This can’t be done in the sidebar, because you can’t execute PHP in a widget (without the help of a plugin). It’s not a requirement, but it guarantees that the right URL will be used, rather than hoping the Google will use the right one.
Customise it with options
Using the codes as shown above will provide the Standard size button, but Google has provided three additional sizes that you can choose from (see the image to the right). If you want to use one of these buttons instead, just add one of the variables as shown below:
You can also eliminate the counter for all but the tall buttons if you just want to show the button itself. In order to do this, add the variable count=”false” to your button code. For example:
So, have you installed the Google +1 button yet? Are you even fussed about it, or is it just a fad? Have you seen much of a response from your readers?