How to add Slider to Blogger
So now I'll show you how to add to your Blogger blog a simple slider that can display the latest post of your feed or latest posts by a specific label.1. Go to your Blogger dashboard
2. Open Theme section - Edit HTML
3. In HTML editor press on your Keyboard CTRL+F and in the search window write
]]></b:skin>
and press Enter, after this code you need paste this CSS:
<style>
.featslider { position: relative; } ul.featured-widget-list,ul.featured-widget-list li{margin:0;padding:0;list-style:none;position:relative }ul.featured-widget-list li{display:none}ul.featured-widget-list li:nth-child(1){display:block;line-height:0}ul.featured-widget-list img{border:0;width:100%;height: 400px; object-fit: cover;}ul.featured-widget-list .featuredbg{width:100%;height:100%;position:absolute;z-index:2;left:0;top:0;opacity:.6;background-image:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg67eLceGySEJCAQ0Yd1yFzJhMYbXfAidr7lcMR1Wy9KiWBmOErrQmD6DtX6Gnn5FgnrZ1XYMxq5qCT3cGiXreitdGwg-HLv4gAYh2fuOKn3blORua1IECzrVMho0uu73DihpdMaQKzKI8/s400/overlay-bg.png);background-position:0% 100%;background-repeat:repeat-x}ul.featured-widget-list .featuredbg:hover{opacity:.1}ul.featured-widget-list h5{position:absolute;left:0;right:0;text-align:center;bottom:10px;z-index:2;color:#fff;margin:0;text-transform: capitalize;padding:10px 20px;line-height:1.9em;letter-spacing:0.3px;font: 600 16px 'Abel', sans-serif;overflow:hidden}ul.featured-widget-list li:hover h5{bottom:30px}ul.featured-widget-list .featured-meta{font: 11px 'Abel', sans-serif;letter-spacing:0.3px;position:absolute;bottom:0;left:0;right:0;text-align:center;z-index:2;color:#fff;opacity:0}ul.featured-widget-list h5, ul.featured-widget-list .featured-meta {-webkit-transition: all 0.3s;-moz-transition: all 0.3s;-o-transition: all 0.3s;transition: all 0.3s;}ul.featured-widget-list li:hover .featured-meta{bottom:20px;opacity:1}.feat-buttons{position:absolute;top:50%;z-index:5;width:100%}
.feat-buttons a{text-indent:-9999px;margin:0 7px;width:15px;height:15px;padding:15px;background:#000;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";filter: alpha(opacity=60);-moz-opacity:0.6;-khtml-opacity:0.6;opacity:0.6;position:relative;-webkit-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%;}.feat-prev{float:left;}.feat-next{float:right;}.feat-buttons a.feat-prev::before, .feat-buttons a.feat-next::before{content:"";width:0;height:0;border-width:6px 7px;border-style:solid;border-color:transparent #fff transparent transparent;position:absolute;top:50%;margin-top:-6px;margin-left:-11px;left:50%}
.feat-buttons a.feat-next::before{border-color:transparent transparent transparent #fff;margin-left:-3px}
</style>
4. Now add before </head>
this code:
<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
5. Save settings.6. Now use JS code to add a slider in a section you want:
<div id="featuredbwidget"></div>
<script type='text/javascript'>
//<![CDATA[
featuredbwidget({
listURL:"https://ht5445yrthfhhghn54553t.blogspot.com/",
featuredNum:5,
listbyLabel:false,
interval:5000,
autoplay:true,
featuredID:"#featuredbwidget"
});
function featuredbwidget(a){(function(e){var h={listURL:"",featuredNum:3,featuredID:"",feathumbSize:1200,interval:5000,autoplay:false,loadingFeatured:"nextfeatured",pBlank:"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXCpXth5FiYs5_L5f3qGXnF_4bCMJTspVVFwWettet6G-zcrcuiz2fsOpUgi6-r26G72EdllCRQG2hPUgEIVpbu3I7mUXdR_dv-xE3eenwaQX3CtHAnHSAA6VTPthXsVuHyLrqH7ZxARw/s500/no-image.png",byMonth:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],listbyLabel:false};h=e.extend({},h,a);var g=e(h.featuredID);var d=h.featuredNum*200;g.html('<div class="featslider"><ul class="featured-widget-list"></ul><div class="feat-buttons"><a href="#" class="feat-prev">Пред</a><a href="#" class="feat-next">След</a></div></div>');var f=function(w){var q,k,m,u,x,p,t,v,r,l="",s=w.feed.entry;for(var o=0;o<s.length;o++){for(var n=0;n<s[o].link.length;n++){if(s[o].link[n].rel=="alternate"){q=s[o].link[n].href;break}}if("media$thumbnail" in s[o]){u=s[o].media$thumbnail.url.replace('s72', 's600')}else{u=h.pBlank.replace(/\/s[0-9]+(\-c|\/)/,"/s"+h.feathumbSize+"$1")}k=s[o].title.$t;r=s[o].published.$t.substring(0,10);m=s[o].author[0].name.$t;x=r.substring(0,4);p=r.substring(5,7);t=r.substring(8,10);v=h.byMonth[parseInt(p,10)-1];l+='<li><a href="'+q+'"><div class="featuredbg"></div><img class="featuredthumb" src="'+u+'"/><h5>'+k+'</h5></a><div class="featured-meta"><span class="fdate"><span class="fday">'+t+'</span> <span class="fmonth">'+v+'</span> <span class="fyear">'+x+'</span></span> - <span class="fauthor">'+m+"</span></div></li>"}e("ul",g).append(l).addClass(h.loadingFeatured)};var c=function(){e(h.featuredID+" .feat-next").click()};var b=function(){e.get((h.listURL===""?window.location.protocol+"//"+window.location.host:h.listURL)+"/feeds/posts/summary"+(h.listbyLabel===false?"":"/-/"+h.listbyLabel)+"?max-results="+h.featuredNum+"&orderby=published&alt=json-in-script",f,"jsonp");setTimeout(function(){e(h.featuredID+" .feat-prev").click(function(){e(h.featuredID+" .featslider li:first").before(e(h.featuredID+" .featslider li:last"));return false});e(h.featuredID+" .feat-next").click(function(){e(h.featuredID+" .featslider li:last").after(e(h.featuredID+" .featslider li:first"));return false});if(h.autoplay){var i=h.interval;var j=setInterval(c,i);e(h.featuredID+" .featslider li:first").before(e(h.featuredID+" .featslider li:last"));e(h.featuredID+" .featslider").hover(function(){clearInterval(j)},function(){j=setInterval(c,i)})}e("ul",g).removeClass(h.loadingFeatured)},d)};e(document).ready(b)})(jQuery)};
//]]>
</script>
And don't forget to change https://ht5445yrthfhhghn54553t.blogspot.com/ by URL from your blog. Video Instruction
Have some questions? Write in the comment below.
10 Comments
Hello one question. How can I make the slider only show popular posts?
I hope you can answer me as it would be very useful for me.
Thanks for the tutorial of this slider, I already went through your channel and I liked it: D
Thank you! :)
Cubitos MC, there is no option to do this
Very Nice Explanation, but I stuck To change image on slider. So kindly guide me how to change my slider image.
https://medicoceptualinn.blogspot.com/
Slider take images automatically from your posts.
Very helpful article for beginners in blogging. I also started my blogging journey in blogger.com and now I shifted to wordpress. The blogger helped me a lot to learn on how to post an article and SEO settings and more. And I hope that after shifting to wordpress I made my news website beautiful and user friendly. So, anybody interested can visit my site Daily News Hunt
Hi, i want a feature post slider like i want to show my selected posts.
Hi. Change listbylabel, whatch on video.
please how can i use it at multiple sections in blogger section
Go to Theme - HTML editor, find place there you need to add another section and paste this code:
<b:section class='section_bottop' id='section_bottop' name='section_bottop'/>