Elegant Popular Post Widget For Blogger

By
Advertisement
Elegant Popular Post Widget For Blogger


Popular post widget is best widget to gain more traffic for your blog . By adding css to widget it makes more elegant and unique design . In this widget separate lining of post title and post body will make a clean look of widget . Background of this widget is a picture background so my opinion only use png format images to look beautiful .

Click On The Below Image To Have A Demo : 





Tutorial : How To Widget To Your Blog 

  • Login To Blogger Dashboard .
  • Click on the Template tab .
  • Now click on Edit Template . ( Before Editing " Backup Your Blogger Template ")

Don't Know How To Backup Blogger Template : Click Here

  • After Backup is done click CTRL+F to find ]]></b:skin> by pasting the code in search box .
  • Now paste the below code just above the ]]></b:skin> .

/* Popular Posts Widget customized by bloggerslab.in */
.PopularPosts .item-thumbnail { display: block; height: 190px; margin: 0; overflow: hidden; position: relative; width: 100%; }
.PopularPosts .item-title { position: relative; }
.PopularPosts img { display: block; height: auto; position: absolute; width:auto; transition: all 1s ease 0s; }
.item-title a { background:rgba(0, 0, 0, 0.35); color: #FFFFFF; font-family: Impact; font-size: 17px; font-weight: 100; padding: 10px 0; position: absolute; right: 0; text-align: center; top: 30px; width: 100%; }
.item-snippet { background:rgba(0, 0, 0, 0.35); color: #FFFFFF; font-weight: 900; left: 12%; padding: 10px; position: absolute; text-align: center; top: 95px; width: 70%; }
.item-content:hover img {transform: rotate(10deg) scale(1.2);}
.item-content { position: relative; }


  • Now save template . Next job is to add javascript to blog .
  • Now Search for </body> in template . Paste the below code just above the </body> .

<script src='//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js'/><script type='text/javascript'>
 $(document).ready(function() {$(&#39;.PopularPosts img&#39;).attr(&#39;src&#39;, function(i, src) {return src.replace( &#39;s72-c&#39;, &#39;s400&#39; );});});
</script>
    <script type='text/javascript'>
    //<![CDATA[
    // Popular Posts customization by bloggerslab.in
    // Trim Code by MS-potilas 2012
    $('.popular-posts ul li .item-snippet').each(function(){
     var txt=$(this).text().substr(0,120);
      var j=txt.lastIndexOf(' ');
      if(j>10)
         $(this).text(txt.substr(0,j).replace(/[?,!\.-:;]*$/,'...'));
    });
    //]]>
    </script>

  • Save template and job is done .

Customization : 
  • If you already added " javascript " to blog remove the colored line in above code and save template .
  • Now go to Layout section and click on Add a gadget .
  • Add the popular post widget to your blog .

Have any doubts or queries feel free to comment below .

1 comment:

  1. You share nice tutorial related blog, which give me some good ideas in creating my own blog, For More Popular Posts widgets you can
    Visit my blog here

    ReplyDelete