Cách thêm Google+ Comment cho Website


Hôm nay tìm hỏi bác google cách thêm google +  comment vào bài viết tiện thể share luôn cho ai đang cần tìm nhé

Và đây là hướng dẫn chi tiết và rất đơn giản, bạn chỉ việc thêm Mã Code vào vị trí trong Website là thành công:

Thêm nhận xét Google+ Comment:

<script src="https://apis.google.com/js/plusone.js">

</script>
<g:comments
    href="[URL]"
    width="642"
    first_party_property="BLOGGER"
    view_type="FILTERED_POSTMOD">
</g:comments>

Dành cho HTML5

<script src="https://apis.google.com/js/plusone.js">
</script>
<div class="g-comments"
    data-href="[URL]"
    data-width="642"
    data-first_party_property="BLOGGER"
    data-view_type="FILTERED_POSTMOD">
</div>

 

Hiển thị số Google+ Comment:

g:comments>: <g:commentcount href="[URL]"></g:commentcount>

Dành cho HTML5

<div class="g-comments">: <div class="g-commentcount" data-href="[URL]"></div>

Chú ý thay thế [URL] = đường dẫn bạn muốn comment, phần này biết Code cho tự động URL là URL hiện tại là Oki.

 

Nếu bạn muốn lấy tự động đường dẫn của website thì sử dụng Code sau:

<div id="comments"></div>

<script>
gapi.comments.render('comments', {
    href: window.location,
    width: '624',
    first_party_property: 'BLOGGER',
    view_type: 'FILTERED_POSTMOD'
});
</script>
Similarly with Google+ Comments Counter: 
<div id="commentscounter"></div>
<script>
gapi.commentcount.render('commentscounter', {
    href: window.location
});
</script>

Chúc các bạn thành công,

 


Có thể bạn quan tâm
28/11/2013
2647