How To Include Google Plus One Button In WordPress Site

How To Include Google Plus One Button In WordPress Site

Jul 27, 2011

7 Flares Facebook 4 Google+ 2 Twitter 1 StumbleUpon 0 LinkedIn 0 7 Flares ×

On my blog site, I always want to improve my social engagement with my audience. Since my site is new and is only less than six months old, I want to see how it grows. With the help of wordpress plugins it became easy for web publishers like me to monitor my blog site. On the internet, there’s a great plugin that you can download to see how many of your audience spread the word about your post on a particular social networking site. It can be downloaded from the ShareThis website and it’s called the ShareThis plugin. Unluckily, this plugin does not include Google Plus One button.

ShareThis plugin can be used on almost every blogging site like WordPress, Blogger, Posterous, Typepad etc. You can even use this plugin on any website that you choose. But for ease of integration on my WordPress site, I use the wordpress plugin version of ShareThis. The only problem is that, after downloading and installing this plugin on my website Google Plus One button is not present. You can only find the buttons for facebook, twitter, email and sharethis. Read this the rest of this post to find out how you can include Google Plus One button.

If you will go to the publisher site, you can find the instruction on how to implement the google+1 button. But what will you see is plain HTML that was intended to be manually inserted on your site’s HTML code. I search all over the internet and found nothing that will direct me to my goal. I want to utilize the power of Google+ but not to implement it manually. I want the google plus one button to be included in my ShareThis plugin.

To solve the problem, I compare the codes from the plugin settings with the instruction provided by ShareThis. Luckily it was easy to spot the hint how to include the google plus one button. See picture below.

plusone hcount How To Include Google Plus One Button In WordPress Site

To go with the flow of the code, I just insert ‘plusone’ on the first text box that contains the facebook, twitter, email and sharethis services. Then, I copy the format of the HTML code that will represent the actual button on my site. All you have to do is to set the class property of the span element to ‘st_sharethis_hcount’. Then I create the necessary HTML code to represent the google plus one button and paste it on the second text box. See example below.

Example:

Facebook button:
<span class=’st_facebook_hcount’ st_title=’<?php the_title(); ?>’ st_url=’<?php the_permalink(); ?>’ displayText=’share’></span>

Google Plus One button:
<span class=’st_sharethis_hcount’ st_title=’<?php the_title(); ?>’ st_url=’<?php the_permalink(); ?>’ displayText=’share’></span>

plusone hcount2 How To Include Google Plus One Button In WordPress Site

After modifying the settings, I save the settings by clicking the ‘Update Share This Options’ button on my wordpress dashboard. By the way I use ‘st_plusone_hcount’ because I choose to use ‘Horizontal Count’ style in the ShareThis plugin. If you want to use a different style just make it sure that you will set the correct value of the ‘class’ property of the span HMTL tag.

That’s it, using plugins are really cool. But you have to wait for the plugin author to upgrade it to include the functionality that you want. Yoi ichinichi o!


6 comments

  1. Al Ingham /

    Just tried doing this… No luck… 
    The code I have is…
    plusone in the first box – as you’ve suggested.
    Then in the HTML box…
    I have:
    <span class='st_facebook_buttons' st_title='’ st_url=” displayText=’share’><span class='st_twitter_buttons' st_title='’ st_url=” displayText=’share’><span class='st_digg_buttons' st_title='’ st_url=” displayText=’share’><span class='st_email_buttons' st_title='’ st_url=” displayText=’share’><span class='st_plusone_buttons' st_title='’ st_url=” displayText=’share’>

    • Eugene M. Villegas /

      Remember that your ShareThis setting (horizontal count, large, vertical count, etc.) should match to the “class” that you will use on the second box of the ShareThis configuration.

    • Eugene M. Villegas /

      Looking at your code, I think you should remove the ‘s’ in the ‘st_plusone_buttons’. A little typo can break it. So you should have ‘st_plusone_button’ if you configured the ShareThis plugin to use “standard” buttons.

       
  2. Eugene M. Villegas /

    ….

  3. Jaap van der Doelen /

    Thanks, works like a charm for me! Awesome!

Leave a Reply

7 Flares Facebook 4 Google+ 2 Twitter 1 StumbleUpon 0 LinkedIn 0 7 Flares ×