Password = 1234

Add Popular Post Slider/Image Gallery In Blogger 


  


You might have seen so many sliders or crousels that works on the recent posts or you have to add images in it manually. In this tutorial i will give you the slider/image gallery that works on the popular posts. This widget shows your 10 popular posts images in form of slider. This slider is made by dynamicdrive.com and i make some changes to make it popular post slider



Animated Preview :



How To Add Popular Post Slider/Image Gallery To Blogger

  • Go to Blogger Dashboard 
  • Click on DropDown Menu and select Template
  • Backup your Template before making any changes to your blog
  • Now Click on Edit HTML --> Proceed --> Expand Widget Templates
  • Press Ctrl + F and search the code shown below
</head>
  • Now Paste the Code shown below just before/above it
<style type="text/css">
#gallery{position:relative;margin:0 35px 20px;width:500px;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/AVvXsEhaBeoDtULohinZjqPa0K5f8gTmDoWByWgV_XIlEAoeCvV6UE0xJ-7l8nP-n8XfptSOxebJpUjolsU8Q9-yCgoAehYpCvzY1S1QIus2c8CdnMDdcojLsAr9-5akmMi2U35kzaIzS2dVtyY/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}
</style>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' type='text/javascript'/>
<script src='http://latest-hacks.googlecode.com/svn/gadgets/popularposts/popular-posts.js' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
stepcarousel.setup({
galleryid: "gallery",
beltclass: "belt",
panelclass: "panel",
autostep: {enable:true, moveby:1, pause:3000},
panelbehavior: {speed:500, wraparound:true, persist:true},
defaultbuttons: {enable: true, moveby: 2, leftnav: ["https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLzyTkzruID_MJrX20qER1vq5z0Mrhrl6Twh6Z8q_bJQcdDZh6asNDudPDsleiSaHPDj8fzs1T-A5MSS-kjVZdZiw3BcGYLjDetx0ZbcAyoHUlbMPNne32K6FPcC6Os5V9cdUeqsAC9v8/s1600/prev.png", -40, 36], rightnav: ["https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx4GGmHGMjeuFRjxOHY-cEWyjqId3kRfXqEl39nGbUZLMg0Jj14vLw1LPjGmLjFsca0kji8m8VMnpRk5bmJvIW_HphOLqlJJtFFPVBlRKF8_Xqaxy33ygNcDhgHtpGCcN-fyahEkCupvE/s1600/next.png", 2, 36]},
contenttype: ["external"]
})
//]]>
</script>

  • Now Find the code shown below using [ctrl+F]
<b:section class='sidebar' id='sidebar' preferred='yes'>
  • Now Paste the Code Shown Below just below/after it
<b:widget id='PopularPosts7' 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/AVvXsEhDET4cNi083MlDYiWgjTwRhPVH9gIJQzvtjJl7_2JXPPFscP0NFUZ-xWiypaSYVLFrUSdKNzRkqLYgisuxMUF0E8U4Ub8E2co_wWSoRRfPxwofWIL2xXChhyphenhyphenBBF8Xn6P7G2BrBYCcdgXA/s1600/defaultimage.jpg'/>
        </b:if>
       </a>
      </b:if>
     </li>
    </b:loop>
   </ul>
  </div></div></b:if>
 </b:includable>
</b:widget>

  • Now save your template

Password = 1234

0 comments:

Post a Comment

 
Top