Welcome To "Softway RKO" !

What You Can Get in Softway RKO?

We provide the tutorials, guides, articles, tricks and tips about Blogger, Blogging, SEO Tips, Basic Tips For New Bloggers, Making Money Online, Widgets, Templates and many more resources. All this is just for free! You can Sign Up to get updated for Latest Posts.

Friday, May 30, 2014

Filled Under:
,

How To add Display posts Views count in blogger


HTML tutorial

Click Below Ad for Leaning Blogging Tricks.

Next Blogger Tricks

In some websites contain post views plugin means when your entered website post then the postviews stored in free database called Firebase this very popular website to create your own database for free.We can now easily  create this post counter without about server codes with a free service Firebase you can now create

Also Read:-Add Socialize it bar below Post Title in Blogger

We are very lucky to add this plugin only in blogger platform and create some dynamic script with the help of this tutorials.
Once you have seen demo then you add this plugin in your blog.Click on This demo link to see Live demo.
Demo
I Hope you have seen this demo and you like this,So Read my instruction to add this plugin in your blog.
 How To add Display posts Views count in blogger:-

  • Create your free account on Firebase
  • Click here to sign up now!
  • Enter your Email address and Password, Click on Create accont
  • Now create a new app Like this image

  • You can insert your app name and app url , not this
  • Now copy your Firebase URL
  • Go to Blogger Dashboard>>Template>>Edit HTML
  • Find this code ]]></b:skin> using (Ctrl+F)
  • Just above it paste the following code


/*-------- Post Views by www.softwayrko.blogspot.com ----------*/
#views-container {
width: 85px;
float: right;
}
.mbtloading {
background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCWYe-iMp7ZkH6WigreKI_Ir4vaFlXE73g4eW8xY0XjBbi2BzGonKEVjhtRJotxbiAQZU9LclAtKhGmaAtnJqxk1XKcatY6zDvjBkRJEPPOMPn07vGaBFyTfBMsBdNlUnIeo5OOVGfl6ok/s320/mbtloading.gif') no-repeat left center;
width: 16px;
height: 16px;
}
.viewscount {
float: right;
color: #EE5D06;
font: bold italic 14px arial;
}
.views-text {
float: left;
font: bold 12px arial;
color: #333;
}
.views-icon{
background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMI63w1aEnsURdU1tRwgPZ67dtwa-Yc3XL-073DMzqjTINJ6XFh9tSwKbpW7yWt_kD7x2EB-h1FZQSoiXmQ-A8COs26P3DtdfZ222-3j15NmbiSmt0Y2-hQPmBLsXjHX7x_rUY-Np98qgJ/s1600/postviews.png') no-repeat left;
border: 0px;
display: block;
width: 16px;
height: 16px;
float: left;
padding: 0px 2px;
}

  • Now find this code </body>
  • Copy the Javascript code beore/above </body>
    <!-- Post Views Script by www.softwayrko.blogspot.com -->
    <script type='text/javascript'>
        window.setTimeout(function() {
            document.body.className = document.body.className.replace(&#39;loading&#39;, &#39;&#39;);
          }, 10);
      </script>
    <script src='https://cdn.firebase.com/v0/firebase.js' type='text/javascript'/>
    <script>
    $.each($(&#39;a[name]&#39;), function(i, e) {
    var elem = $(e).parent().find(&#39;#postviews&#39;).addClass(&#39;mbtloading&#39;);
    var blogStats = new Firebase(&quot;https://softwayrko.firebaseio.com/pages/id/&quot; + $(e).attr(&#39;name&#39;));
    blogStats.once(&#39;value&#39;, function(snapshot) {
    var data = snapshot.val();
    var isnew = false;
    if(data == null) {
    data= {};
    data.value = 0;
    data.url = window.location.href;
    data.id = $(e).attr(&#39;name&#39;);
    isnew = true;
    }
    elem.removeClass(&#39;mbtloading&#39;).text(data.value);
    data.value++;
    if(window.location.pathname!=&#39;/&#39;)
    {
    if(isnew)
    blogStats.set(data);
    else
    blogStats.child(&#39;value&#39;).set(data.value);
    }
    });
    });
    </script>

    • Replace  https://softwayrko.firebaseio.com with your Firebase URL
    • Now find this code <data:post.body/>
    Note:If you have seen maximum number of <data:post.body/> then choose the last two <data:post.body/>
    • Paste the following code before <data:post.body/>
    <!-- Post Views Counter by www.softwayrko.blogspot.com -->
    <div id='views-container'><span class='views-icon'/><div class='views-text'>Views:</div> <div class='mbtloading viewscount' id='postviews'/></div>

    • Now the last step find this tag <head> 
    • Paste the Jquery Code after <head>
    <script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'></script>

    •  If this Code already add your template then no needs to add this code
    • Finish Enjoy! 
    Final Words
    Visit your blog and refresh the page using press key F5 I f you are not successful in this process or if you getting errors during this process , so write your problems in comment box and don't forget to click on like button or join my Facebook Page.
    Happy Blogging!





                                                                    0 blogger-facebook:

                                                                    Comment here

                                                                     
                                                                  • Home
                                                                  • About Us
                                                                  • Contact Us
                                                                  • Sitemap
                                                                  • Privacy Policy
                                                                  • Back To Top