عداد مواضيع

مشاهدات الان

 ضعها بالمكان المناسب

الاضافه لـ إعداد اللغة HTML/JavaScript

<b:if cond='data:view.isPost'><span class='post-view' expr:data-id='data:post.id'> <i class='far fa-eye'/><span class='view-load' id='postviews'><i class='fas fa-spinner fa-pulse faa-fast'/></span> </span></b:if>

البحث عن

</head>

فوقه

<!-- Jquery Library and Font Awesome CDN -->

<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'/>

<link crossorigin='anonymous' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css' integrity='sha256-46qynGAkLSFpVbEBog43gvNhfrOj+BmwXdxFgVK/Kvc=' rel='stylesheet'/>

البحث عن

</body>

فوقه

<script type='text/javascript'>

//<![CDATA[

jQuery.getScript('//cdn.firebase.com/js/client/2.3.2/firebase.js').done(function() {

$.each($(".post-view[data-id]"),function(c,f){var b=$(f).parent().find("#postviews").addClass("view-load"),d=new Firebase("https://lesson4kh-e36d1.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>

/* Post Views format

----------------------------------------------- */

.post-view{display:inline-block;float:right;padding:4px 8px;font-size:14px;color:565252;text-align:center;line-height:17px;border-radius:90em;box-shadow: 0 2px 2px 0 rgba(0,0,0,.05), 0 1px 5px 0 rgba(0,0,0,.05), 0 2px 1px -2px rgba(0,0,0,.2);background:FFFDFD;}

.post-view>i{padding:0 5px 0 0}

@media screen and (max-width:680px){

.post-view{display:none}

}

اتبع

https://gretathemes.com/count-post-views/#google_vignette

ونستمر

إرسال تعليق

أحدث أقدم