Styling jetpack sharing google plus button

Nothing profound.

I use jetpack so I wanted to use the provided sharedaddy module.

The google plus button is a new addition and displays the medium button with default annotation.

I don’t have the traffic to display annotations. I want to use the small button.

So per google’s docs, I edited the sharing-sources.php file

from

[crayon lang=”php”]
public function get_display( $post ) {
return ‘

function removeCountsFromGooglePlus() { if (jQuery('.googleplus1_button iframe')) { jQuery('.googleplus1_button iframe').attr("src", jQuery('.googleplus1_button iframe').attr("src").replace(/size=/,"annotation=none&size=")); } }

Note: (9/2012) Google updated their api to change from count=false to annotation=none. Snipped above updated to reflect this…

jQuery(‘.googleplus1_button iframe’).attr(“src”, jQuery(‘.googleplus1_button iframe’).attr(“src”).replace(/count=true/,”count=false”));

This entry was posted in software development and tagged , , by Ken Judy. Bookmark the permalink.

About Ken Judy

I am an executive leader, software developer, father and husband trying to do more good than harm. I am an agile practitioner. I say this fully aware I say nothing. Sold as a tool to solve problems, agile is more a set of principles that encourage us to confront problems. Broad adoption of the jargon has not resulted in wide embrace of these principles. I strive to create material and human good by respecting co-workers, telling truth to employers, improving my skills, and caring for the people affected by the software I help build.