Add plus one button to WordPress site

Add plus one button to WordPress site

01.06.2011

There is no official WordPress plugin yet that lets you add  the plus one button to a WordPress site, but there is a way to do it. You just have to edit the code snippet from Google a little before you insert it on your WordPress site.

How to add plus one button to a WordPress site

If you just want the button on the single pages and posts, it is easy, you just needs to insert the code straight the way Google gives it to you here. (I told you how here)

But if you want it on the blog-page, the archive pages the tag pages and all the other pages on your WordPress site, you have to modify it a little before you insert it. But it is easy, change the code to this before you insert it:

<g:plusone size=”tall” href=”<?php the_permalink(); ?>”></g:plusone>

Put that snippet in single.php, in page.php, in index.php, in category.php, in archive.php and in all the places you want it. Be sure to put it in the WordPress loop (just above <?php the_content(); ?> for example).

And be sure to add the javascript in the header too. This: <script type=”text/javascript”src=”http://apis.google.com/js/plusone.js”></script>

Add plus one button top WordPress

You can as well change the word “tall” to “medium” or “small” if you want another design of the button.

That easy it is. Good luck and remember to “plus-one” the posts you like!

 

Advertising
  • http://www.analyticsforjoomla.com AnalyticsJoomla

    A Joomla plugin is already available. I hope this is a pleasant surprise from the Joomla community? Read more about the plugin here: http://www.analyticsforjoomla.com/updates/google-1-button-for-joomla.html

    • http://jonathanbjorkskog.com/ Jonathan björkskog

      Aha! Great! Then it will not last long until there is a plugin for WordPress as well..:)

  • Anonymous

    Whether there is an ‘official’ plugin is a little irrelevant. Many people like to code so this is useful info

    • http://jonathanbjorkskog.com/ Jonathan björkskog

      That´s true! Thank you!

  • http://www.simplyclicks.com/ David Burdon

    Jonathon,

    many thanks. I’ve used your snippets to include in my blog. Seems to work fine.
    Regards,
    David Burdon

    • http://twitter.com/JonathanBJ Jonathan Björkskog

      Great if you liked it! Regards Jonathan

  • http://www.simplyclicks.com/ David Burdon

    Jonathan,
    saw your Tweet about increased traffic. I’ve just given you a mention on WebProWorld: http://www.webproworld.com/webmaster-forum/threads/109464-Google-1-Button

    • http://twitter.com/JonathanBJ Jonathan Björkskog

      Thank you! 

      When checking Analytics I saw that I got some visitors from webproworld.com too! 

  • Anonymous

    Thanks for this, I’ve been wondering how and when I’ll use the Google +1 feature. I’m also wondering how to link to HotPot reviews and associate a locality based business to their Places Page. In some way, all this will need to be tied together eventually.

    • http://www.facebook.com/Jonathan.Bjorkskog Jonathan Björkskog

      You´re welcome! Yeah, Google is messing with so many things now, I wonder where it will end up..:)

  • Hi

    nice.

    dressup
    games

     free
    games

     
     

  • GardeningHater

    I was recommended to your blog from WebProWorld to read about installing the +1 button, and found this a very helpful post.

  • שגיב אמרי

    Love it! thanks alot :)

  • http://www.joyoge.com Joyoge Design Bookmarks

    thank you

  • http://twitter.com/catfitz CatherineFitzpatrick

    I couldn’t figure this out. So I found an easier way:

    1. Go to Appearance and then Widgets
    2. Find “Texts” which is for HTML code.
    3. Drag it over into the sidebar
    4. Paste the Google+ snippet
    5. This works for the whole site, at least on mine it appears to

    But I couldn’t figure out how to get it to work on a single post. I pasted the code into a single post, and nothing shows up. Something is interfering.

    • http://jonathanbjorkskog.com/ Jonathan björkskog

      Yes, that works as well. But then when clicking the button, you “plusses” the main domain, not the post you are in. Now there are plugins as well, if you want to add it to single posts in an easier way..

  • Haroon_083

    Thanks

  • http://caramembuatada.blogspot.com Cara Dan Cara

    very Nice .. Thanks

    • http://jonathanbjorkskog.com/ Jonathan björkskog

      You’re welcome!

  • http://www.facebook.com/addcolours Madhusudhan Chary Rali

    thanks for posting

  • http://www.facebook.com/addcolours Madhusudhan Chary Rali
  • Ms Thảo

    thanks!
    well come to view mys plus:

    Angry Birds birthday
    cake

  • David Johnson

    I use the sharbar plugin and it allows you to easily add the plus one

    • http://jonathanbjorkskog.com/ Jonathan björkskog

      Yes it does. But sometimes you want more flexibility, and then this trick is good to know about! :)

  • http://www.favorit-web.com/ Nenad Vujic

    Thanks for post. I put the code in the single.php. I hope it wort it.

    http://real-estate-great.com/in_serbia/

    • http://jonathanbjorkskog.com/ Jonathan björkskog

      Did it work? :)

  • http://www.freeonlinetips.in Antony Pratap

    That was easy! Thanks, I managed to make one for me.

    • http://jonathanbjorkskog.com/ Jonathan björkskog

      Great! :)

  • http://twitter.com/Metrowestmama Metrowest Mama

    I am just a simple Mom Blogger and I came across your site when I was looking for help on how to do this. Was able to succeed thanks to your straightforward directions! Thanks. And if you could do a post for the Facebook Like and Tweet buttons (like you have above) so I don’t have to use a plugin, that would be great! Thanks again for a great post.

  • jinjinchou

    want some girl pictures to look at ?
    here are 1000 pictures of Japanese Girl Gravure Photos

  • Angelica Mendoza

    I am going insane. I don’t know much about code, but I would like to get this right. I tried using the javascript you posted above, but It would not work. I had to paste the following javascript from Google Webmaster Tools in the header to get my button to appear on my site http://www.thenoshmosh.com.

      (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);  })();  I have the plus one button on my site now, but I cannot get it to work properly. I get a red exclamation point when I click the button. I haven’t blocked 3rd party cookies, and I am able to use the plus one function on other sites. I am stuck. Please help.

    Thank you!

    • Nathan

      I get the same results, the red exclamation arrow. Perhaps the href code is no longer supported by Google for some reason?

  • http://www.squidoo.com/daftar-facebook-fb-baru-gratis Daftar facebook baru

    Love it! thanks alot :)

  • http://securityuniform.blogspot.in/2011/12/housekeeping-uniforms-represent-your.html Housekeeping Uniforms

    This information is very useful I added it to my blog..

Download new responsive WordPress template

New responsive WordPress template with big call-to-action-areas, header-slider and different color-themes. It is built on Bootstrap and named Strap Them Boots On. Read more and download!

The one writing here:

Important information

This is the search engine optimization (SEO) and web tactics webiste/blog for Jonathan Björkskog, working at and co-owning Genero Digital Agency, a digital advertising agency based in Helsinki, Finland. If you searched for my Swedish blog, you find it here: jonathanbjorkskog.se.

That's one of my passions.

If you were searching for the other one, kitesurfing, you should check out my kitesurfing blog instead.

Follow on Facebook

Head over to the wall and send me all your questions about Facebook, SEO, or any other awesome topic on the internet!

Premium SEO-Plugin

Brian D. Hawkins about SEOPressor:

It’s almost as if SEOPressor took those features from my checklist. I guess I’m old school but I have a checklist that I use when writing new posts. It’s pretty cool that SEOPressor helps automate some of those tasks and the check/remind feature is very nice. As usual I love your presentation.

http://hotblogtips.com/about

Click Here to Download
SEOPressor
Read my SEOPressor review