Family Encyclopedia >> Electronics

How to add the Google +1 button to your WordPress

Yesterday, Google announced the launch of its long-awaited +1 button. This is a great step in adding social aspects to search results. In this article, we'll discuss everything you need to know about the Google +1 button, including a step-by-step guide to adding it to your WordPress blog or site.

What is the Google +1 button?

Google's +1 button is a great step in adding a social aspect to search results. It's similar in concept to the Facebook Like button, except for search results. In google's words, it's your friend's way of saying "this is great" or "you should check this out". In other words, it's a public way of stamping something with your approval, so your friends, contacts, and others on the web find the best results when they search. This +1 button is currently available in English searches on Google.com.

Similar to the Facebook Like button, the Google +1 button will also show the faces of your contacts (Gmail, Buzz and Reader).

Why use the Google +1 button?

While Google has stated that this won't affect search rankings, in the interview with Mashable, Google representative Jim Prosser said this is something the company is "very interested" in incorporating in some form at some point in the future. . It's already true that when you sign in to Google, you see different results than when you sign out. We believe that this +1 button will have a significant impact on search results in the near future, even if the public announcement is not made. So you better start using it right away and get the most out of it.

We could only imagine that this is something that will be added to Google Banner Ads and potentially other social networks in the future.

How to add Google +1 in WordPress

Google has created an official page for publishers that contains numerous sizes, however, there are some customizations that you need to make if you are using WordPress. So follow the steps below:

Open your theme footer.php file and paste the following code above the closing of your body tag:

 

If you are using a theme framework in which case you won't have the footer.php file, paste the following code into your functions.php Archive area or custom functions:

 función add_googleplusone () echo ''; add_action ('wp_footer', 'add_googleplusone'); 

Once you have pasted the JavaScript, now open the theme file where you want to add the Google +1 button. Most likely it is your single.php proceedings. Before we go ahead with this, there are numerous size options. Here is a reference guide:

How to add the Google +1 button to your WordPress

The code to paste into your template for each size is below. Just copy the one you like best and paste it inside your post loop.

 // Código para pegar para el botón alto  // Código para pegar para el botón Estándar  // Código para pegar para el botón medio  // Código para pegar para el Botón Pequeño  

If you want to show the button without counting, you can add the parameter count="false" in the code above. An example of the code should look like this (note that this doesn't work with the Height size because you must have the count):

Yesterday you shared a very interesting tip by showing how you can track Google +1 interaction in Google Analytics. If you want to track your Google +1 button interaction, change the Google +1 code to look like this:

 

And then add the following code in the footer of your site below the script we added in step 1. The example code should look like this:

 function plusone_vote (obj) _gaq.push (['_ trackEvent', 'plusone', obj.state]); 

We have already added the button to our site. Will you add/use it??