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: 3338 lượt đọc


Bài viết liên quan

6 nguyên tắc cơ bản khi thiết kế web cho di động
Progressive Web App: Xoá nhoà khoảng cách giữa web và mobile app
 Những nguyên tắc bạn cần biết khi thiết kế website bán hàng
4 điều bạn cần biết khi kết hợp kiểu chữ
Doanh nghiệp nên xem trước khi thiết kế web
5 sai lầm SEO thường gặp khi thiết kế lại trang web của bạn