Cách thêm Google+ Comment cho Website

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,

 


Ngày đăng: 3220 lượt đọc


Bài viết liên quan

5 nguyên tắc chính trong thiết kế logo
Theme WordPress miễn phí cực chất
Hướng dẫn cách chụp hình đẹp cho sản phẩm
600 icon giáng sinh dạng vector
5 xu hướng thương mại điện tử đáng chú ý năm 2015
5 lời đồn về sáng tạo có lẽ bạn tin