Google +1 with WordPress (and Jetpack Sharedaddy)

[UPDATE: JetPack 1.2 released on Nov 17th 2011 has Google Plus support now] Unfortunately the WordPress ShareDaddy plugin (that comes with the Jetpack plugin) does not have Google +1 support currently, and adding it as a custom item does not work.

So, I modified one of the .php files from the ShareDaddy plugin to include this support. You will need either this plugin [1] or this one [2] installed first, in this example, I am using [1], but you can use any one if you know its shortcode.

The additions you need to make are in the sharing-service.php file. The diff is here, and this is the patched sharing-service.php file (from Jetpack ShareDaddy 1.1.2) . Below is an image and line location (lines 436-437) for the additions (click to enlarge):

This adds Google +1 to the end of the items shared by ShareDaddy. Change the shortcode to the one that your plugin comes with, I used this plugin [1] where the shortcode is ‘wgdpo_plusone’, for the other plugin [2], the shortcode is ‘google1′.

NOTE: If you upgrade to 1.1.3, it goes without saying you will have to re-apply the patch.

19 Comments

  1. jdGONEMAD says:

    thanks for the solution!

  2. Atif Iqbal says:

    how can I get the Google +1 share url?

  3. Jimmyjames says:

    Thank you! Works like a charm!

  4. Richard says:

    Thanks.

    I now have two Google +1 buttons. One from the plugin and one from Sharedaddy.

    Any thoughts on fixing this?

  5. juliaL49 says:

    Many thanks for this :)

    Richard, just untick the box “Show comment box in posts” – that’s what worked for me.

  6. noah says:

    beautiful – works like a charm. Just what I needed – Thanks.

  7. James says:

    I find that this solution leaves the G+1 a little higher than the other share buttons. To correct this, simply add the following to your CSS:

    .wdgpo {
    padding: 3px 0 0 0;
    }

    Lines right up!

  8. Christy says:

    Ah this worked great! Thanks for posting this.

  9. ton says:

    Is it broken for anyone else after the JetPack 1.1.3 update?

  10. shazron says:

    @ton – if you update to 1.1.3, you’ll have to re-apply the patch of course…

  11. hkalant says:

    Nice!
    Actually, this solution leaves the G+1 button a little lower than the other share buttons. Any ideas to fix this?
    Thank you.

  12. J says:

    Thanks so much for this walk through, and to James for the styling fix.

  13. shazron says:

    @hkalant see James styling fix in one of the comments

  14. [...] dus is mijn ID 101796699500372929105. PS: ik heb met behulp van de oplossing op shazron.com de share daddy plugin aangepast zodat bij de artikelen ook een +1 [...]

  15. Karl says:

    Hi!

    I have Sharedaddy installed without Jetpack and this fix didn’t work. Is there anything Jetpack-specific in here? Any advice on how to fix it?

    Thanks,

    Karl

  16. Sledge says:

    .wdgpo {
    padding: 3px 0 0 0;
    }

    that CSS does not work for me because I am using the other google + plugin.
    I am assuming i need to change wdgpo the something else in the CSS code but what to?

  17. Thomas says:

    Thanks a lot!

    Works flawlessly for my blog. I have placed it directly before the line

    $parts[] = $visible;

    and thus Google+1 is the first item which appears on the line. I prefer this sequence.
    Best regards
    Thomas

  18. [...] add the button, I’ve followed the simple and clear instructions of shazrom.com. The only annoying bit is that the button is not perfectly aligned to the Twitter, [...]

  19. JFC says:

    Is there anyway to install those button in the post header instead of the end??

Leave a Reply