Adding Google Plusone +1 Button
For bloggers, the button's been integrated on the dashboard. It means if you're a blogger user, you can activate the service just by activating the "Share" function on your blog. - Here is how: go to your Blogger Dashboard and then visit the Design/Layout page. After, click on the "Edit" below the Page Element "Blog Posts", and then check the "Show Share Buttons" of the option, and then click Save.
Lately, i also find another function due to this Google+ button that seems have to be activated. Try to visit your New Blogger Setting Tab and go to the "Post And Comment" configuration. There you'll find what i mean here.
Out of all above, there is also a manual way that you can make. The code isn't realy too long. Here we go.
1. Javascript To Render The Button: There is a few options to choose, but here i'll tell you only two scripts.
Normally placed just above the tag < /head> or < /body>.
*Basic Code.
< script src="https://apis.google.com/js/plusone.js" type="text/javascript">
{lang: 'US'};
< /script>
*Advanced Code.
< script type="text/javascript">
window.___gcfg = {lang: 'US'}; window.___gapisync = false;
(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>
Google said, the first script above will run a little slower. And such, it will probably affect the page load.
2. Html Code To Call The Button: Choose whichever you think prefferable.
Normally placed below each post. In this case, place the code below after the tag < data:post.body/>. There could be two of the above tag, choose the first one.
1.1. < g:plusone>< /g:plusone>
1.2. < g:plusone size='standard' expr:href='data:post.url'>< /g:plusone>
1.3. < div class='g-plusone' data-size='medium' expr:href='data:post.url'>< /div>
*The button size is measured by these values: standard, medium, or small.
Just, don't ask me why i don't implement +1 button here. :D
0 comments:
Post a Comment
Click to see the code!
To insert emoticon you must added at least one space before the code.