Notification texts go here Contact Us Buy Now!

Cara Membuat Post View Count di Blog

 


View count merupakan salah satu plugin yang bisa menampilkan jumlah visitor yang telah berkunjung ke website kamu.

Jika kamu ingin mencoba memasang plugin ini ke dalam website kamu, oh iya tutorial ini hanya berlaku untuk blogger. Jadi untuk membuatnya silahkan terlebih dahulu membuat akun firebas, untuk lebih lengkapnya kamu bisa mengikuti lanngkah-langlah berikut.

Pertama letakann terlebih dahulu kede javascript di bawah ini di atas kode </head>.

<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js' type='text/javascript'></script>

Kemudian tempelkan Javascript di bahwah ini di atas </body>.

<script src='https://cdn.firebase.com/js/client/2.3.2/firebase.js' type='text/javascript'></script>
<script type='text/javascript'>
//<![CDATA[
// View counter
$.each($(".post-view[data-id]"),function(c,f){var b=$(f).parent().find("#postviews").addClass("view-load"),d=new Firebase("https://mantandekat.firebaseio.com/pages/id/"+$(f).attr("data-id"));d.once("value",function(e){var h=e.val(),g=!1;null==h&&(h={},h.value=0,h.url=window.location.href,h.id=$(f).attr("data-id"),g=!0),b.removeClass("view-load").text(h.value),h.value++,"/"!=window.location.pathname&&(g?d.set(h):d.child("value").set(h.value))})});
//]]>
</script>

Selanjutnya untuk menampilkan count viewer letakan kode di bawah ini di tempat sesuai yang kamu inginkan.

<span class='post-view' expr:data-id='data:post.id'><i class='fa fa-eye'/> <span class='view-load' id='postviews'>0</span> Viewers</span>

Save template blogger kalian

Getting Info...

About the Author

IT Enthusiast

Posting Komentar

Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.