Is it possible to add a Google +1 button using the HTML widget?

  • 1
  • Question
  • Updated 7 years ago
  • Answered
I'd like to add a Google +1 button to my website. I've been trying to add it using the HTML widget but it always comes out blank. Is it because the code is Javascript rather than HTML? Is there anything I can do to change this?
Photo of Polly

Polly

  • 26 Posts
  • 0 Reply Likes

Posted 7 years ago

  • 1
Photo of Brandon

Brandon

  • 243 Posts
  • 33 Reply Likes
Hi there Polly,

This is indeed possible! Simply paste the following code into an HTML widget:

<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="medium"></g:plusone>

<!-- Place this tag after the last plusone tag -->
<script type="text/javascript">
(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);
})();
</script>


You can substitute 'medium' for 'small' or 'tall' to alter the size accordingly. You can also leave it blank to keep it standard sized.

The above code worked perfectly on my site, so give it a try and see what happens. There shouldn't be any issues!

Let me know if you have any trouble!

Kind regards,
Brandon
Photo of Polly

Polly

  • 26 Posts
  • 0 Reply Likes
Hi Brandon,
Thanks for your reply.

Unfortunately this is the same code I have been using... I have just pasted your copy of it into the widget but it is still blank! I'm confused because I already have a Facebook 'Like' button which worked perfectly fine.

Any ideas?

Many thanks,
Polly
Photo of Brandon

Brandon

  • 243 Posts
  • 33 Reply Likes
Ok I've tested once again with both a Google and Facebook button on the same page, and it works fine. When I first paste the code, nothing appears, however this is normal. After you insert the code, have you tried refreshing the page to see if it appears? Because when I refresh it then shows up.

If the problem still persists, I'll leave it in the hands of a Yola staff member to take the matter further.
Photo of Brandon

Brandon

  • 243 Posts
  • 33 Reply Likes
Hmm that's very strange. Other than the Facebook button, do you have any other HTML that you have added to your page?
Photo of Polly

Polly

  • 26 Posts
  • 0 Reply Likes
Genius! Refreshing the page worked like a charm... I really hadn't thought of it because the Facebook button popped up on it's own!
Thank you so much for your help, it is very much appreciated :)
Polly
Photo of Brandon

Brandon

  • 243 Posts
  • 33 Reply Likes
Ah that's great to hear! Yup, when in doubt, I always refresh :) I'm glad I could help you out.

Regards
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Kudos to you Brandon for helping out on this thread! Thanks so much!