{"id":2808,"date":"2012-04-26T20:49:14","date_gmt":"2012-04-27T00:49:14","guid":{"rendered":"http:\/\/judykat.com\/ken-judy\/?p=2808"},"modified":"2014-07-20T13:44:57","modified_gmt":"2014-07-20T17:44:57","slug":"styling-jetpack-sharing-google-plus","status":"publish","type":"post","link":"https:\/\/judykat.com\/ken-judy\/styling-jetpack-sharing-google-plus\/","title":{"rendered":"Styling jetpack sharing google plus button"},"content":{"rendered":"<p>Nothing profound.<\/p>\n<p>I use jetpack so I wanted to use the provided sharedaddy module.<\/p>\n<p>The google plus button is a new addition and displays the medium button with default annotation.<\/p>\n<p>I don&#8217;t have the traffic to display annotations. I want to use the small button.<\/p>\n<p>So per <a href=\"https:\/\/developers.google.com\/+\/plugins\/+1button\/#plusonetag\">google&#8217;s docs<\/a>, I edited the <strong>sharing-sources.php<\/strong> file<\/p>\n<p><strong>from<\/strong><\/p>\n<p>[crayon lang=&#8221;php&#8221;]<br \/>\n\tpublic function get_display( $post ) {<br \/>\n\t\treturn &#8216;<\/p>\n<div class=\"googleplus1_button\">\n<div class=\"g-plusone\" data-size=\"medium\" data-callback=\"sharing_plusone\" data-href=\"' . esc_attr( get_permalink( $post->ID ) ) . &#8216;&#8221;><\/div>\n<\/div>\n<p>&#8216;;<br \/>\n\t}<br \/>\n[\/crayon]<\/p>\n<p><strong>to<\/strong><\/p>\n<p>[crayon lang=&#8221;php&#8221;]<br \/>\n\tpublic function get_display( $post ) {<br \/>\n\t\treturn &#8216;<\/p>\n<div class=\"googleplus1_button\">\n<div class=\"g-plusone\" data-size=\"small\" data-annotation=\"none\" data-callback=\"sharing_plusone\" data-href=\"' . esc_attr( get_permalink( $post->ID ) ) . &#8216;&#8221;><\/div>\n<\/div>\n<p>&#8216;;<br \/>\n\t}<br \/>\n[\/crayon]<\/p>\n<p><strong>Better approach<\/strong><\/p>\n<p>Of course, the above hack reverted the next time I updated jetpack. So, I did this in javascript instead:<\/p>\n<pre class=\"lang:js decode:true \" title=\"Change styling on google plus to remove counts\" >\r\nfunction removeCountsFromGooglePlus()\r\n{\r\n\tif (jQuery('.googleplus1_button iframe'))\r\n\t{\r\n                jQuery('.googleplus1_button iframe').attr(\"src\", jQuery('.googleplus1_button iframe').attr(\"src\").replace(\/size=\/,\"annotation=none&amp;size=\"));\r\n\t}\r\n}<\/pre>\n<p>Note: (9\/2012) Google updated their api to change from count=false to annotation=none. Snipped above updated to reflect this&#8230;<\/p>\n<p><del datetime=\"2012-09-30T21:10:29+00:00\">jQuery(&#8216;.googleplus1_button iframe&#8217;).attr(&#8220;src&#8221;, jQuery(&#8216;.googleplus1_button iframe&#8217;).attr(&#8220;src&#8221;).replace(\/count=true\/,&#8221;count=false&#8221;));<\/del><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t have the traffic to display annotations. I want &hellip; <a href=\"https:\/\/judykat.com\/ken-judy\/styling-jetpack-sharing-google-plus\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[30],"tags":[78,853,854],"class_list":["post-2808","post","type-post","status-publish","format-standard","hentry","category-software-development","tag-google","tag-jetpack","tag-social"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/judykat.com\/ken-judy\/wp-json\/wp\/v2\/posts\/2808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/judykat.com\/ken-judy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/judykat.com\/ken-judy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/judykat.com\/ken-judy\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/judykat.com\/ken-judy\/wp-json\/wp\/v2\/comments?post=2808"}],"version-history":[{"count":2,"href":"https:\/\/judykat.com\/ken-judy\/wp-json\/wp\/v2\/posts\/2808\/revisions"}],"predecessor-version":[{"id":3286,"href":"https:\/\/judykat.com\/ken-judy\/wp-json\/wp\/v2\/posts\/2808\/revisions\/3286"}],"wp:attachment":[{"href":"https:\/\/judykat.com\/ken-judy\/wp-json\/wp\/v2\/media?parent=2808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/judykat.com\/ken-judy\/wp-json\/wp\/v2\/categories?post=2808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/judykat.com\/ken-judy\/wp-json\/wp\/v2\/tags?post=2808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}