Add a Popular Posts Gallery Just above your Blogger posts

The most solid and popular web design incline over last couple of years is a sliding horizontal type of Panels knows as Sliders. It is a very useful way to increase your website traffic and connect with the users. This widget appears the most poplar 10 posts on your site just over your Blogger posts.


How to Add

Note: Before adding, make a backup of your template because this widget is not fully useful for all templates.

Step # 1: Go to your dashboard > Template > Edit HTML > Press Ctrl + F and open search box

Step # 2: copy and paste the following code in the search box
 ]]></b:skin>  
Step # 3: Just Above/before it, add the following code.
#gallery{position:relative;margin:0 35px 20px;width:590px;height:126px;background:#ffffff}#gallery .belt{position:absolute;top:0;left:0;list-style-type:none}#gallery .panel{float:left;margin:20px;width:84px;height:86px;background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjh3gYekkO_NC-OsBAEQpu20QiJKKCPrNT3Mqd4rhCSs9114JBiHDXlfpqomkgmMgf1uG7RttgI36oAhMeG6-yy0n3M5gq6dlmAUybYJSZbty6Odr_9jUYYASi1UtOClBE7A8cXHVjXmcfX/s1600/bg-slider.png) bottom center no-repeat;overflow:hidden}#gallery .panel img{float:left;border:1px solid #DDD;margin:5px;width:72px;height:72px;background:#FFF;padding:0px}#gallery .panel img:hover{filter:alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity:0.5;opacity:0.5} 
Note: Now you can set the size of gallery, according to your need, change the values in red ( 590 and 126)

Step # 4:  Now search the following code
</head>
Step # 5: Just above/before it, add the following code
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>
<script src='http://helplogger.googlecode.com/svn/trunk/auto-slider.js' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
stepcarousel.setup({
galleryid: "gallery",
beltclass: "belt",
panelclass: "panel",
autostep: {enable:true, moveby:1, pause:6000},
panelbehavior: {speed:500, wraparound:true, persist:true},
defaultbuttons: {enable: true, moveby: 2, leftnav: ["https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilhg5XejGDNmOXhk0MoT4QVZTXt5mX0jdVeu6_cOYLgmaN01TWTaoEKK6GRgJOkV5JIktZ_EcTpKye_we_UqhlqmUpbsXzlS-uNwU5oZmfjUyhXYqIEKfe5gqSA1E1xEC-auZMuOfquNfL/s1600/prev.png", -40, 36], rightnav: ["https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNTYw71JUrIz66eIfapbhXN7MFdvb4fyLBb1kSUGFb_BWAT6eF4uPtyPT5lWP8E4YJaPVLB3kscWKcYWQ23l-lE8Oskcyp_paeCSmSpioVcjNHVpUXQnnLYFw_MvnodvDZb45PFcNuEzap/s1600/next.png", 2, 36]},
contenttype: ["external"]
})
//]]>
</script>
Next step to do is to place the widget just above the blog post

Step # 6: Search the following code
<b:section class='main' id='main' showaddelement='yes'> 
or if cannot the find than find the following code
<b:section class='main' id='main' showaddelement='no'> 
Step # 7: Now below it, add the following code
<b:widget id='PopularPosts2' locked='false' title='Popular Posts' type='PopularPosts'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'><div style='margin-top:20px;margin-bottom:70px;margin-left:-20px;'>
  <div id='gallery'>
   <ul class='belt'>
    <b:loop values='data:posts' var='post'>
     <li class='panel'>
      <b:if cond='data:showThumbnails == &quot;false&quot;'>
       <b:if cond='data:showSnippets == &quot;false&quot;'>
        <a expr:href='data:post.href' expr:title='data:post.title' rel='bookmark'><data:post.title/></a>
       <b:else/>
        <div class='item-title'>
         <a expr:href='data:post.href' expr:title='data:post.title' rel='bookmark'><data:post.title/></a>
        </div>
        <div class='item-snippet'>
         <data:post.snippet/>
        </div>
       </b:if>
      <b:else/>
       <a expr:href='data:post.href' expr:title='data:post.title' rel='bookmark'>
        <b:if cond='data:post.thumbnail'>
         <img expr:alt='data:post.title' expr:src='data:post.thumbnail'/>
        <b:else/>
         <img alt='no image' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibGq_oMQznJi6e4VQ6dzjvCCqs87WCHoPYyfDA5mv0LP2SC04lIowd-4vVVu9kprQywcvtXQsFmhUzffl1V9wBWgZ6Mm0K8P-qiRwiecKzmGlxgkANhjQS58X756YR80XUpixVL1Mcyfo9/s1600/no-image.PNG'/>
        </b:if>
       </a>
      </b:if>
     </li>
    </b:loop>
   </ul>
  </div></div></b:if>
 </b:includable>
</b:widget>
Note:delete the fragments of code in blue if you want this widget to be show in post pages also

Step # 8: Save template

Done. i hope this post become useful for you.


0 comments:

Post a Comment

Blog Archive