Showing posts with label Widgets. Show all posts
Showing posts with label Widgets. Show all posts

Thursday

How to Add Social Media Buttons to Blogger Posts? - Top/Bottom Location

In this tutorial you will learn how to add social sharing buttons to each of your blogger posts. These responsive social sharing buttons will stick to the top or bottom of every blog post. It helps your blog visitors to share your content on social media networks without leaving your blog page.



add social media buttons to blogger posts



This sharing gadget for blogspot blogs is a lightweight version of JumboShare Counter. I will thus call it JumboShare Simplified. It loads faster and takes up negligible load time. Load time is a major SEO factor and Google will rank you higher in SERPs only if your webpage loads faster and provides a user friendly interface.




I have created this lightweight sharing gadget by aligning all major social media buttons inside a horizontal row. Users can toggle the gadget to expand or collapse the number of sharing buttons displayed.    



This gadget includes the following social media buttons:




  1. Facebook


  2. GooglePlus +1


  3. Twitter


  4. LinkedIn


  5. Pinterest


  6. StumbleUpon


  7. Buffer


  8. Viber - Will automatically display in mobile devices


  9. Whatsapp - Auto displayed in mobile devices


  10. Print



These buttons have the exact same look and style as their official counterparts. It uses the official stylesheet for Facebook, Google, Twitter and the rest.



social sharing buttons for blogspot blogs



The viber and whatsapp share buttons will display only in mobile devices such as smartphones. Your visitors can now share your blog posts with their viber contacts and whatsapp friends. I am using IsMobileRequest condition to allow these buttons to display only smartphones instead of using CSS display:none.



You can choose to display this social sharing gadget just below blog post title or you can display it at the bottom of every blog post. Lets get straight to work.



Note: If you are using Jumboshare counters plugin, then you will need to remove them first.


Add Social Media Buttons To Blogger Posts



Follow these easy steps:




  1. Go To Blogger > Theme > Backup your theme


  2. Click Edit HTML


  3. Search for ]]></b:skin> and paste the following CSS code just above ]]></b:skin>




    /* ##### JumboShare Simplified ####### */


    #MBTshares-wrap{margin:20px 0px;border-top: 1px dotted #eee;padding: 10px 0;border-bottom: 1px dotted #eee;overflow:hidden}


    #MBTshares{display:inline-block;overflow:hidden;text-align:left;white-space:nowrap;font-family:arial;font-size:11px;margin:0px 5px 0; line-height: 1.4em;}


    #horiz{position:relative; padding:0; margin:0;}


    #horiz #MBTshares{position:relative;top:-8px; padding-top:20px;}


    #MBTshares a:hover{text-decoration:none!important;}


    /***Facebook***/


    .mbt-fb{background:transparent linear-gradient(#4C69BA,#3B55A0) repeat scroll 0 0;border:medium none;border-radius:2px;color:#FFF;cursor:pointer;font-weight:700;height:20px;line-height:20px;padding:0 6px;text-shadow:0 -1px 0 #354C8C;white-space:nowrap;text-shadow:0 -1px 0 #354C8C}


    .mbt-fb:focus,.mbt-fb:hover,.mbt-fb:active{background:transparent linear-gradient(#5B7BD5,#4864B1) repeat scroll 0 0;border-color:#5874C3 #4961A8 #41599F;box-shadow:0 0 1px #607FD6 inset}


    .mbt-fb i{padding:2px 2px 0 4px;font-size:11px;color:#3B5998;background:#fff;margin-right:4px;margin-top:3px}


    .mbt-fb:hover, .mbt-fb:visited, .mbt-tw:hover,.mbt-tw:visited, .mbt-linkedin:hover ,.mbt-linkedin:visited{color:#fff!important;}


    /***Gplus, Pinit, Stumbleupon***/


    .mbt-gp{box-shadow:0 1px 0 rgba(0,0,0,0.05);transition:background-color .218s ease 0s,border-color .218s ease 0s,box-shadow .218s ease 0;background-color:#FFF;background-image:none;border:medium none;border-radius:2px;border:1px solid rgba(0,0,0,0.17);color:#262626;cursor:pointer;font-weight:700;height:20px;line-height:20px;padding:0 6px 0 4px;white-space:nowrap}


    .mbt-gp:hover, .mbt-gp:visited{color:#262626!important;}


    #MBTshares .pinit{background:#f9f9f9!important}


    #MBTshares .stumb{background:#f0fafe!important;border:1px solid #cde3ea}


    #MBTshares .stumb:hover{border:1px solid #b7d5df;box-shadow:0 1px 0 rgba(0,0,0,0.1)}


    #MBTshares .stumb i{color:#eb4823!important;font-size:13px!important;margin-top:1px!important}


    .mbt-gp:focus,.mbt-gp:hover,.mbt-gp:active{border:1px solid rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.1)}


    .mbt-gp i{padding:2px 2px 0 0;font-size:11px;color:#DB4437;margin-right:2px;margin-top:3px}


    .mbt-gp .fa-pinterest{padding:0 2px 0 0;font-size:14px}


    #MBTshares .bufferimg{width:15px; margin-top:2px; padding:0 1px 0 0; }


    /***LinkedIn***/


    .mbt-linkedin{transition:background-color .218s ease 0s,border-color .218s ease 0s,box-shadow .218s ease 0;background-color:#0077B5;text-shadow:0 -1px #005887;border:medium none;border-radius:2px;border:1px solid #066094;color:#fff;cursor:pointer;font-weight:700;height:20px;line-height:20px;padding:0 2px 0 1px;white-space:nowrap}


    @media screen and (-webkit-min-device-pixel-ratio:0) {


    .mbt-linkedin{padding:0 5px 0 1px}


    }


    .mbt-linkedin:focus,.mbt-linkedin:hover,.mbt-linkedin:active{border:1px solid #0369A0;background-color:#0369A0}


    .mbt-linkedin i{padding:0;font-size:17px;color:#FFF;margin-right:0;position:relative;left:1px}


    .mbt-linkedin .ibg{background:#0369A0 none repeat scroll 0 0;width:17px;display:inline-block;border-right:1px solid #006095;border-radius:2px;height:20px;padding:0 2px 0 1px;margin:0 2px 0 -1px}


    /**Twtter, Print, Whatsapp, viber**/


    .mbt-tw{position:relative;height:22px;padding:4px 8px 1px 4px;font-weight:700;color:#FFF;cursor:pointer;background-color:#1B95E0;border-radius:3px;box-sizing:border-box}


    .mbt-tw:focus,.mbt-tw:hover,.mbt-tw:active{background-color:#0C7ABF}


    .mbt-tw i{padding:0 0 0 1px;font-size:14px;color:#fff;margin-right:2px;margin-top:0}


    .mbt-o{max-width:100%}


    .mbt-o,.mbtcount-o,.mbt-fb,.mbt-gp,.mbt-linkedin,.mbt-tw,.label,#mbtcount{display:inline-block;vertical-align:top}


    .mbtcount-o{position:relative;min-width:15px;height:17px;text-align:center;padding:1px 5px;margin-left:2px;background:#FFF none repeat scroll 0 0;border:1px solid #e7e7e7;border-radius:2px;display:none!important; }


    #MBTshares .printme {background-color:#333;}


    #MBTshares .printme:focus,#MBTshares .printme:hover,#MBTshares .printme:active{background-color:#000}


    #MBTshares .whatsapp{background-color:#73D40B;}


    #MBTshares .whatsapp i{font-size:15px!important;}


    #MBTshares .whatsapp:focus,#MBTshares .whatsapp:hover,#MBTshares .whatsapp:active{background-color:#65BA09}


    #MBTshares .viber{background-color:#7b519d;}


    #MBTshares .viber:focus,#MBTshares .viber:hover,#MBTshares .viber:active{background-color:#8558aa}


    #MBTshares .viberimg{width:13px; margin-top:0px; padding:0 3px 0 0; }


    #mbtcount{color:#666;white-space:nowrap;text-decoration:none;padding:2px 0 0}


    #mbtcount:hover{text-decoration:none}


    #MBTshares .arrow{height:0;left:-10px;position:relative;top:-15px;width:5px;z-index:2}


    #MBTshares .ext{min-height:18px!important}


    #MBTshares .arrow s,#MBTshares .arrow i{border-color:transparent #e7e7e7;border-style:solid;border-width:4px 5px 4px 0;display:block;position:relative;top:19px}


    #MBTshares .arrow i{border-right-color:#FFF;left:2px;top:11px}


    .share-btn{position:relative;display:inline-block; display:none!important;}


    .share-btn .h2{font-size:30px;font-weight:700;font-family:arial;color:#73D40B;height:31px; line-height: 1.4em;}


    .share-btn .h4{font-size:12px;font-family:arial}





    /*#########Horizontal Switch###########*/


    .switchoff2{display:inline-block;}


    .mbtswitch2{padding:0 15px 0 3px;position:relative;top:-15px;margin:20px 0 0 3px;display:inline-block;max-width:30px;height:20px;cursor:pointer;background-color:#fff;border:1px solid #eee;border-radius:2px;outline:0 none;font:16px fontawesome;color:#ddd}


    .mbtswitch2:hover{color:#73D40B}


    .mbtswitch2 i.active:after{content:'\f067';position:relative;left:7px;top:2px;font-style:normal}


    .mbtswitch2 i.inactive:after{content:'\f068';position:relative;left:7px;top:2px;font-style:normal}


    @media only screen and (max-width:230px) {


    .tcount{border-bottom: 2px solid #74D50C; border-right:none; min-width:100%;}


    #horiz #MBTshares {width: 100%;}





  4. Paste the following code just above </head> inside your template:

    (OPTIONAL STEP) Skip this step if you have already added JQuery and FontAwesome libraries inside your templates.




    <script async='' src='https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'></script>

    <link href='http://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css' rel='stylesheet'/>






  5. Next add the follow jQuery script just above </body> tag




    <script type='text/javascript'>

            //<![CDATA[


            /* ##### FREE JUMBOSHARE SIMPLIFIED #######


    Developed by: www.MyBloggerTricks.com


    Dual licensed under the MIT license and GPL license.


    Copyright (c) 2015-2016 STCnetwork.org


    */


    $(document).ready(function() {


    $(".mbtswitch").click(function(){$(".switchoff").slideToggle();if($(".mbtswitch i").attr("class")==="active"){$(".mbtswitch i").removeClass("active").addClass('inactive')}else if($(".mbtswitch i").attr("class")==="inactive"){$(".mbtswitch i").removeClass("inactive").addClass('active')}});



    $(".mbtswitch2").click(function(){$(".switchoff2").slideToggle();if($(".mbtswitch2 i").attr("class")==="active"){$(".mbtswitch2 i").removeClass("active").addClass('inactive')}else if($(".mbtswitch2 i").attr("class")==="inactive"){$(".mbtswitch2 i").removeClass("inactive").addClass('active')}});

    });


    //]]></script>






  6. Save your template.





Add Social Media Buttons at Top/Bottom Of Every Blog Post



add sharing buttons in blogger



Follow these easy steps to add sharing buttons just below every blog post title or the post footer:



Inside your theme, search for  <data:post.body/> . This code is located twice, once for mobile view and once for desktop view. Therefore consider the second appearance of <data:post.body/> only.



Note: If you want to show this horizontal sharing bar below post titles, then paste the following HTML code just above <data:post.body/>   but if you wish to display the sharing bar at bottom of each blog post then paste the following HTML code just below <data:post.body/>



If you want to display the sharing buttons both at top and bottom of each blog post, then paste the following HTML code once above <data:post.body/> and once below <data:post.body/>.




<b:if cond='data:blog.pageType == &quot;item&quot;'>



<div id='MBTshares-wrap'>



<!--TOTAL-->


<div class='share-btn tcount' data-service='total'>


        <div class='count h2 anim'/>


        <div class='h4'>SHARES</div>


</div>


<span id='horiz'>



<!--FACEBOOK-->


<div id='MBTshares'>


<div class='mbt-o'>


<a class='mbt-fb' expr:href='&quot;http://www.facebook.com/share.php?v=4&amp;u=&quot; + data:post.url + &quot;&amp;t=&quot; + data:post.title' onclick='window.open(this.href,&apos;sharer&apos;, &apos;toolbar=0,scrollbars,status=0,width=626,height=436&apos;); return false;' rel='nofollow' target='_blank' title='Share on Facebook!'><i class='fa fa-facebook'/><span class='label'>Share</span></a>


</div>


<div class='mbtcount-o'>


<div class='arrow'><s/><i/></div>


<span class='share-btn' data-service='facebook'>


<span class='count anim' id='mbtcount'/></span>


</div>


</div>



<!--PINTEREST-->


<div id='MBTshares'>


<div class='mbt-o'>


<a class='mbt-gp pinit' expr:href='&quot;http://pinterest.com/pin/create/button/?url=&quot; + data:post.url + &quot;&amp;media=&quot; + data:post.thumbnailUrl + &quot;&amp;description=&quot; + data:post.title' onclick='window.open(this.href,&apos;sharer&apos;, &apos;toolbar=0,scrollbars,status=0,width=626,height=436&apos;); return false;' rel='nofollow' target='_blank' title='Pin it!'><i class='fa fa-pinterest'/><span class='label'>Pin it</span></a>


</div>


<div class='mbtcount-o ext'>


<div class='arrow'><s/><i/></div>


<span class='share-btn' data-service='pinterest'>


<span class='count anim' id='mbtcount'/></span>


</div>


</div>



<!--TWITTER-->

<div id='MBTshares'>


<div class='mbt-o'>


<a class='mbt-tw' expr:href='&quot;http://twitter.com/home?status=&quot; + data:post.title + &quot;-&quot; + data:post.url' onclick='window.open(this.href,&apos;sharer&apos;, &apos;toolbar=0,scrollbars,status=0,width=626,height=436&apos;); return false;' rel='nofollow' target='_blank' title='Share on Twitter!'><i class='fa fa-twitter'/><span class='label'>Tweet</span></a>


</div>


</div>



<!--LINKEDIN-->

<div id='MBTshares'>


<div class='mbt-o'>


<a class='mbt-linkedin' expr:href='&quot;http://www.linkedin.com/shareArticle?mini=true&amp;url=&quot; + data:post.url' onclick='window.open(this.href,&apos;sharer&apos;, &apos;toolbar=0,scrollbars,status=0,width=626,height=436&apos;); return false;' rel='nofollow' target='_blank' title='Share on Linkedin!'><span class='ibg'><i class='fa fa-linkedin'/></span><span class='label'>Share</span></a>


</div>


<div class='mbtcount-o ext'>


<div class='arrow'><s/><i/></div>


<span class='share-btn' data-service='linkedin'>


<span class='count anim' id='mbtcount'/></span>


</div>


</div>



<!--GOOGLE PLUS-->


<div id='MBTshares'>


<div class='mbt-o'>


<a class='mbt-gp' expr:href='&quot;https://plus.google.com/share?url=&quot; + data:post.url' onclick='window.open(this.href,&apos;sharer&apos;, &apos;toolbar=0,scrollbars,status=0,width=626,height=436&apos;); return false;' rel='nofollow' target='_blank' title='Share on Google Plus!'><i class='fa fa-google-plus'/><span class='label'>Share</span></a>


</div>


<div class='mbtcount-o ext'>


<div class='arrow'><s/><i/></div>


<span class='share-btn' data-service='google'>


<span class='count anim' id='mbtcount'/></span>


</div>


</div>



<!--STUMBLEUPON-->


<div id='MBTshares'>


<div class='mbt-o'>


<a class='mbt-gp stumb' expr:href='&quot;http://www.stumbleupon.com/submit?url=&quot; + data:post.url' onclick='window.open(this.href,&apos;sharer&apos;, &apos;toolbar=0,scrollbars,status=0,width=626,height=436&apos;); return false;' rel='nofollow' target='_blank' title='Stumble it!'><i class='fa fa-stumbleupon'/><span class='label'>Share</span></a>


</div>


<div class='mbtcount-o ext'>


<div class='arrow'><s/><i/></div>


<span class='share-btn' data-service='stumbleupon'>


<span class='count anim' id='mbtcount'/></span>


</div>


</div>



<div class='switchoff2' style='display:none;'>



<!--BUFFER-->


<div id='MBTshares'>


<div class='mbt-o'>


<a class='mbt-gp' expr:href='&quot;https://buffer.com/add?url=&quot; + data:post.url + &quot;&amp;picture=&quot; + data:post.thumbnailUrl + &quot;&amp;text=&quot; + data:post.title + &quot;&amp;via=stc_network&quot;' onclick='window.open(this.href,&apos;sharer&apos;, &apos;toolbar=0,scrollbars,status=0,width=626,height=436&apos;); return false;' rel='nofollow' target='_blank' title='Share on Buffer!'><img class='bufferimg' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT9fRVmIn_9q4RX29Q2LWYlGWFDjmt7k4STQ8xv4rtri2LR1jiUZ4NTwnAQ2PrNvC7o5qWo7_KTC8kTOXAgZRcPRSWeMMHwezfTgEIdvWAkA5oCgirRWE8V2y5H9cSaJZK32pCnU_Ibuxr/s1600/logo-icon.png'/><span class='label'>Buffer</span></a>


</div>


<div class='mbtcount-o ext'>


<div class='arrow'><s/><i/></div>


<span class='share-btn' data-service='buffer'>


<span class='count anim' id='mbtcount'/></span>


</div>


</div>


<b:if cond='data:blog.isMobileRequest == &quot;true&quot;'>

<!-- WHATSAPP -->



  <div id='MBTshares'>


    <div class='mbt-o'>


      <a class='mbt-tw whatsapp' expr:href='&quot;whatsapp://send?text=&quot; + data:post.title + &quot; &gt;&gt; &quot; + data:post.url' rel='nofollow' target='_blank' title='Share on whatsapp!'><i class='fa fa-whatsapp'/><span class='label'>SMS</span></a>


    </div>


  </div>



<!-- VIBER -->


  <div id='MBTshares'>


    <div class='mbt-o'>


      <a class='mbt-tw viber' expr:href='&quot;viber://forward?text=&quot; + data:post.title + &quot; &gt;&gt; &quot; + data:post.url' rel='nofollow' target='_blank' title='Share on viber!'><img class='viberimg' src=' https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg74bg90nBrR-SWk_CF_BpJMBawzNuDF3XezEhC91-r6Y3qj-IAgi8GUMtIViFdY6zmMzQNX__-BS7PrrNkg4vLrzCNjXUm3KABbhoLPFLoulU9aIhKP25HV_2YCoUsQTgKm7nSl23lGeu6/s1600/Icon_small.png'/><span class='label'>Share</span></a>


    </div>


  </div>


</b:if>



<!-- PRINT -->


  <div id='MBTshares'>


    <div class='mbt-o'>


      <a class='mbt-tw printme' href='javascript:window.print()' rel='nofollow' target='_blank' title='Print this page!'><i class='fa fa-print'/><span class='label'>Print</span></a>


    </div>


  </div>



</div> <!--switchoff-->



<span class='mbtswitch2'><i class='active'/></span>

</span>


</div></b:if>




Customization Guide:




  • All button locations are labeled for easy readability. You can easily change/swap the locations of button within the widget.


  • Replace stc_network  with your buffer handle or profile username or simply your blog title without spaces.


  • If you wish to display a social media button in mobile devices only then paste its code inside the yellow highlighted tags.


  • All buttons inside the purple highlighted tags will remain hidden when page loads and will be displayed only when the user clicks the +/- toggle button. Buttons will display using this toggle button which we named the switch.


  • If you wish to add more buttons inside the switch then simply copy its code and paste it inside the purple switch tags.


  • To remove buttons from inside the switch, simply copy the button's code and paste it above the switch tag i.e. <div class='switchoff2' style='display:none;'>



Save your template and you are all done!



Need Help in Add Sharing buttons in Blogger?



Let me know if you have any queries. I would love to answer all your questions. More interesting tutorials on its way because I am back to blogging. Peace buddies! =)

Monday

Create Automatic Table Of Contents In JavaScript - TOC Plugin

Wikipedia loves adding an automatic Table Of Contents list for each article it publishes because it engages readers more by providing more accessibility and better navigation. Google prefers high-quality content which is well organized and formatted. Adding elements like tables, numbered sections, and an auto-generated TOC is a big bonus for ranking high in SERPS.

Update: TOC Plugin Version 2.0 has been released.  More advanced with more features!

TOC Plugin: Automatic Table of Contents using JavaScript

In this article, we will share a lightweight TOC plugin written in pure JavaScript to generate an automatic table of contents from the section headings of a web page. 

DEMO: The contents table bellow is dynamically created on page load using this TOC Script.

    What is Table Of Contents or TOC?

    In websites, a table of contents abbreviated as TOC or ToC, is a link list, usually found on a web page placed right after the first paragraph. Each anchor link inside a TOC takes you to a specific section of the web page.

    An HTML TOC provides a quick way to jump to the desired section of a page. It usually includes the titles of the first-level headers (headings) or second level headers(subheadings).

    Table Of Contents of a wikipedia page

    In printable work, a TOC refers to the index page of the book which contains the page number to each chapter. TOC for books are more in-depth and comprehensive, containing not only section titles but descriptions, author names, and subheadings.

    table of contents of a drawing book

    What Is TOC Plugin?

    TOC plugin developed by MBT, is an automatic solution to the tedious method of creating a table of contents manually for each web page. It auto-generates a user-friendly TOC for your lengthy blog articles. It is coded in pure JavaScript and loads lightening fast. Contents table generated using TOC plugin is easily crawled and indexed by search robots.

    • Read this interesting article by MOZ which mentions SEO support for all JS methods that we have used so far in building TOC plugin.

    SEO ALERT: Just minutes after this post was published. Google not only indexed the TOC  anchor Links but also added a "Jump to" label to identify that it is an anchor link that jumps to a particular section. See it to believe it. :)

     Table of contents anchor links indexed by Google

    I have not included lower level heading tags (i.e. h3/h4/h5/h6) in TOC plugin because a blog post is neither a wiki nor a long lengthy book, it is best to show only major headlines for simplicity and accessibility. Adding subheadings or lower levels inside a TOC list only makes it longer in length thus pushing down your main content and destroying visibility.

    Automatic Table Of Contents for blogger blogs

    So far many developers have written a dynamic ToC script but most of these scripts are either coded in jQuery or they are render-blocking JS eating up your page load time. You may even find TOC generator but these scripts again lack flexibility and ease of customization.

    TOC should be added only to those articles which are lengthy or contain at least four headings. On contrary, some TOC generators will add the list on all your pages whether containing several headings or just a single heading, which of course is not a sensible thing to do.

    jQuery table of contents is much slower compared to this plugin built with traditional pure JS. JavaScript is executed much faster by browsers compared to a JS library (jQuery) that needs to be imported first.

    Features of TOC Plugin:

    It is the first JavaScript plugin of its kind that is unique in several ways as mentioned below:

    • Coded in pure JavaScript - just 10 lines of code!
    • Lightweight and fast.
    • SEO Friendly
    • Adds unique ID to each section automatically.
    • Creates both ordered or unordered list
    • Contains a Toggle button
    • Show on any location you choose
    • Easily Customized
    • Mobile responsive
    • Executes only when invoked!

    Pseudo Code Of TOC Plugin

    Understand how the TOC Script works in plain English. The numbered list below is the pseudo code for our TOC plugin. It is a simplified description of the JavaScript code we wrote.

    Table Of Contents for blogspot blogs

    1. Create a function to print headline links
    2. Count the number of heading sections on a page
    3. Run a loop equivalent to the number of heading sections
    4. Extract text content from the heading titles
    5. Give each heading a different ID
    6. Convert the heading text into an anchor link
    7. Print the heading anchor links inside a bullet list
    8. Find the location by TOC ID to display the list
    9. End the loop
    10. Trigger the function only when invoked inside the page

    Table Of Contents with show/hide button

    Following is the pseudo code for the toggle button which shows or hides the TOC.

    1. Create a new function to show/hide the TOC.
    2. Show the TOC by default
    3. Use a conditional statement to check if TOC is hidden or visible.
    4. Use CSS to show or hide the TOC
    5. Trigger the function only when button is clicked

    How To Install TOC Plugin in Blogger Blogs?

    I am sharing below the method of adding TOC plugin in Blogspot blogs but you can apply almost the exact same method for installing this plugin on any website you want, may it be hosted on Wordpress or anywhere else.

    Follow these steps to install it in BlogSpot:

    1. Sign in Blogger > Template
    2. Backup your template
    3. Click "Edit HTML"
    4. Just above </head> tag paste the following source links:
             

      <link href='http://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css' rel='stylesheet'/>
      <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'/>

      <script type='text/javascript'>
      //<![CDATA[

      //*************TOC plugin by MyBloggerTricks.com
      function mbtTOC() {var mbtTOC=i=headlength=gethead=0;
      headlength = document.getElementById("post-toc").getElementsByTagName("h2").length;for (i = 0; i < headlength; i++)
      {gethead = document.getElementById("post-toc").getElementsByTagName("h2")[i].textContent;document.getElementById("post-toc").getElementsByTagName("h2")[i].setAttribute("id", "point"+i);mbtTOC = "<li><a href='#point"+i+"'>"+gethead+"</a></li>";document.getElementById("mbtTOC").innerHTML += mbtTOC;}}function mbtToggle() {var mbt = document.getElementById('mbtTOC');if (mbt .style.display === 'none') {mbt .style.display = 'block';} else {mbt .style.display = 'none';}}
      //]]>
      </script>



      Note that I am adding source links to Oswald font and Font-Awesome for styling purposes. You may or may not wish to add them. The code inside purple highlighted lines is the major TOC script in no more than 10 lines!



      Make this change only if needed:



      The major heading tag in blogger is H2 but if you are selecting the subheading tag in blogger editor then your default tag would be H3. If you are using the subheading tag as your main heading in your blog posts then please replace h2 with h3 thrice in the code above.  TOC plugin will not work if your heading tag is not correct.




    5. Next search ]]></b:skin> and just above it paste the following CSS code:

            

      /*####Automatic TOC Plugin by MyBloggerTricks####*/
      .mbtTOC{border:5px solid #f7f0b8;box-shadow:1px 1px 0 #EDE396;background-color:#FFFFE0;color:#707037;line-height:1.4em;margin:30px auto;padding:20px 30px 20px 10px; font-family:oswald, arial;display: block;width: 70%;}
      .mbtTOC ol,.mbtTOC ul {margin:0;padding:0;}
      .mbtTOC ul {list-style:none;}
      .mbtTOC ol li,.mbtTOC ul li {padding:15px 0 0; margin:0 0 0 30px;font-size:15px;}
      .mbtTOC a{color:#0080ff;text-decoration:none;}
      .mbtTOC a:hover{text-decoration:underline; }

      .mbtTOC button{background:#FFFFE0; font-family:oswald, arial; font-size:20px;position:relative; outline:none;cursor:pointer; border:none; color:#707037;padding:0 0 0 15px;}
      .mbtTOC button:after{content: "\f0dc"; font-family:FontAwesome; position:relative; left:10px; font-size:20px;}



      Make these color changes if you want:




      • To change background color of TOC box edit #FFFFE0


      • To change border color of TOC box edit #f7f0b8


      • To change font color of TOC headline text edit #707037


      • To change anchor link color edit #0080ff


      • To change font size of anchor links edit 15px


      • To change font size of TOC headline text edit 20px




    6. Finally search for <data:post.body/> and replace it with the code below:

      Note: You will find two or more occurrences of this code so replace all its instances with the code below. TOC Plugin will not work if you replace <data:post.body/>  just once.



      <div id="post-toc"><data:post.body/></div>



    7. Save your template and you are all done!



    Show Table Of Contents Automatically in Blog Posts



    Each time you may want to display TOC inside a specific post, follow these two steps.



    Step #1  Mention Location Of TOC Container



    It is best to display TOC right after your starting paragraph or show it before the first heading on your blog post.



    To do this, switch to "HTML" mode of blogger editor and then paste the following HTML code just before the first heading or anywhere else you may want.



    <div class="mbtTOC"> 
    <button onclick="mbtToggle()">Contents</button>
    <ol id="mbtTOC"></ol>
    </div>



    • You can replace the text "Contents" with any other text you may like.


    • If in case your headings already contain numbers in beginning then replace ol with ul.



    Add Table Of Contents automatically in blog posts



    Step #2    Activate TOC Plugin



    Finally, its time to invoke the plugin so that it could auto-generate a TOC on page load,



    To do this, paste the following JS code at the bottom of your blogger editor where your post ends:



    <script>mbtTOC();</script>


    Invoke TOC plugin



    Publish your post and see the magic! :)



    TOC Plugin Copyrights



    Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.



    © 2008-2017 MyBloggerTricks.com

    Version: 1.0  2017/02/14



    TOC Plugin by MyBloggerTricks (MBT) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.



    You are most welcomed to share the plugin with your readership as long as you attach attribution link back to this page. You are most welcomed to use the plugin in your commercial products as long as you keep the source credits intact.



    Need Help With TOC Plugin?



    I tried my best making this tutorial as easy as possible but if there is anything you could not understand then please feel free to post your queries below in the comment section. I would love to answer as soon as possible.



    I hope it adds a positive impact on your SERPS ranking and help you in making your content more search-friendly. I will develop the plugin with time, adding more features and functionalities if required. Till then, I would love to hear your feedback on this.  :)


    Headlines News Widget For Blogger Blogs With Tooltips

    Headlines News Widget is an awesome, super lightweight plugin for Blogger blogs, which shows headlines of your recent posts as a scrolling text, floating from left to right. It's a horizontal auto scrolling recent posts widget for blogger that is responsive and automatic. It's built using Blogger JSON Feeds API and jQuery News Ticker plugin.

    headlines news widget for blogger with tooltips Scrolling headline news widget surely makes your introductory texts standout and noticeable as soon as a visitor lands on your blog. It's the best way to draw visitors attraction towards your featured content.



    What is a Headlines News Widget For Blogger?

    Headlines News widget is basically a news ticker plugin which shows latest headlines of your blogspot blog as a horizontal scrolling text. It's the first news ticker of its kind for blogger blogs that does not only display your title links like ordinary tickers found across the web but also shows post info such as:

    • Author Name
    • Author Avatar
    • Comments Link
    • Comments Count
    • Published Date
    • Featured Thumbnail
    • Post description/summary snippet

    [Desktop View]

    headlines news widget for blogspot with tooltips

    You can choose to display recent posts by label by specifying a particular category or you can simply choose to show latest posts. It can easily be customized to change its background colors and fonts. Headline news widget is mobile responsive and fits perfectly to different screen sizes.

    [Mobile View]

    news headlines widget - mobile responsive

    We have already released its simplest version but today we will add some more features to it like CSS3 tooltips to display description and featured image. To add a simple news gadget for blogger without tooltips then please check the following tutorial:

    If in case you want a simple news widget to display text, custom html or even RSS/Atom feed then try our jQuery Announcement widget, where you can display headline news in vertical scroll.

    Is Headlines News Ticker Standards-Compliant?

    Headlines News ticker widget uses CSS and jQuery to create the scrolling text animation. It does not uses the <marquee> tag. We are using standards-compliant jQuery script and CSS3 to make the text scroll across the screen. The text animation is controlled used navigation such as play/pause and Next/Previous buttons, which makes it really easy for website visitors to navigate between scrolling headlines. 

    headlines news ticker widget for blogger

    The marquee tag is a non-standard HTML element which causes text to scroll up, down, left or right automatically. This feature is obsolete now and its use is discouraged by W3C.

    Features of Headlines News Widget

    Headlines News Ticker is an advanced widget equipped with these features:

    • Author Avatar
    • Displays latest posts dynamically
    • Displays recent posts from a specific category/label
    • Tooltips support
    • Shows Post Description/Summary
    • Shows Featured Thumbnail Image
    • Scrolling text with two animations: reveal & fade
    • Clickable Comments Count
    • Custom Date Format
    • Title Length is adjustable
    • Fully Customizable - Multi Colors!
    • Responsive and mobile friendly
    • Controls Navigation. Play/Pause, Next/Previous
    • Support all browsers: Firefox, Chrome, IE, Safari etc.
    Headlines News Widget Specs
    Created Dec 10, 2016
    Last Update Jan 23, 2017
    Compatible Browsers IE9, IE10, IE11, Firefox, Safari, Opera, Chrome, Edge
    Technology Used JSON, CSS3, HTML4, jQuery, JavaScript
    Layout Mobile Responsive
    Platform Support Google Blogger 1.0
    Text Direction LTR

    How To add Headlines News Widget In Blogger?

    Follow these easy steps:

    1. Go To Blogger > Template
    2. Backup your template
    3. Click "Edit HTML"
    4. Just below <head> tag paste the following JS and CSS source links:
             

      <link href='http://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css' rel='stylesheet'/>
      <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'/>

    5. Next search ]]></b:skin> and just above it paste the following code:
             

      /*--------------Headlines News Widget By MyBloggerTricks.com----------*/

      .ticker-wrapper.has-js{margin:20px 0;padding:0 20px;width:780px;height:32px;display:block;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;background-color:#f8f0db;font-size:.75em}
      .ticker{width:710px;height:23px;display:block;position:relative;overflow:hidden;background-color:#f8f0db}
      .ticker-title{padding-top:9px;color:#900;font-weight:700;background-color:#f8f0db;text-transform:uppercase}
      .ticker-content{margin:0;padding-top:9px;position:absolute;color:#1F527B;font-weight:700;background-color:#f8f0db;overflow:hidden;white-space:nowrap;line-height:1.2em}
      .ticker-content a{text-decoration:none;color:#1F527B}
      .ticker-content a:hover{text-decoration:underline;color:#0D3059}
      .ticker-swipe{padding-top:9px;position:absolute;top:0;background-color:#f8f0db;display:block;width:800px;height:23px}
      .ticker-swipe span{margin-left:1px;background-color:#f8f0db;border-bottom:1px solid #1F527B;height:12px;width:7px;display:block}
      .ticker-controls{padding:8px 0 0;list-style-type:none;float:left}
      .ticker-controls li{padding:0;margin-left:5px;float:left;cursor:pointer;height:16px;width:16px;display:block}
      .ticker-controls li.jnt-play-pause{background-image:url(../images/controls.png);background-position:32px 16px}
      .ticker-controls li.jnt-play-pause.over{background-position:32px 32px}
      .ticker-controls li.jnt-play-pause.down{background-position:32px 0}
      .ticker-controls li.jnt-play-pause.paused{background-image:url(../images/controls.png);background-position:48px 16px}
      .ticker-controls li.jnt-play-pause.paused.over{background-position:48px 32px}
      .ticker-controls li.jnt-play-pause.paused.down{background-position:48px 0}
      .ticker-controls li.jnt-prev{background-image:url(../images/controls.png);background-position:0 16px}
      .ticker-controls li.jnt-prev.over{background-position:0 32px}
      .ticker-controls li.jnt-prev.down{background-position:0 0}
      .ticker-controls li.jnt-next{background-image:url(../images/controls.png);background-position:16px 16px}
      .ticker-controls li.jnt-next.over{background-position:16px 32px}
      .ticker-controls li.jnt-next.down{background-position:16px 0}
      .js-hidden{display:none}
      .no-js-news{padding:10px 0 0 45px;color:#F8F0DB}
      .left .ticker-controls,.left .ticker-content,.left .ticker-title,.left .ticker{float:left}
      .left .ticker-controls{padding-left:6px}
      .right .ticker-controls,.right .ticker-content,.right .ticker-title,.right .ticker{float:right}
      .right .ticker-controls{padding-right:6px}
      /*########Default Style by MBT#########*/
      .ticker-wrapper.has-js{margin:0 0 -200px;padding:0;width:98%;min-height:242px;display:block;border-radius:0;background-color:#fff;border:0 solid #eee;font-size:12px;overflow:hidden}
      .ticker{width:80%;height:42px;display:block;position:relative;overflow:visible;background-color:#fff}
      .ticker-title{background:#71db00;padding:9px 10px;color:#FFF;font-size:16px;font-family:oswald;text-transform:uppercase;text-shadow:1px 1px 6px #666}
      .ticker-title:after{left:90px;top:10px;height:0;width:0;position:absolute;content:" ";pointer-events:none;margin-left:0;margin-top:1px;border-left:13px solid #71db00;border-top:10px solid transparent;border-bottom:10px solid transparent;-moz-transform:scale(.9999)}
      .ticker-content{background-color:#fff;margin-left:18px!important;color:#444;margin-top:1px!important;overflow:visible!important; padding-top: 2px!important;}
      .ticker-swipe{background-color:#fff;position:relative;top:6px;left:110px!important}
      .ticker-swipe span{margin-left:1px;background-color:#fff;border-bottom:1px solid #333;height:12px;width:7px}
      .ticker-controls{padding: 0px!important;margin: 17px 0 0 10px!important;list-style-type:none;position:relative;right:-50px}
      .ticker-controls li{padding:0;margin-left:5px;float:left;cursor:pointer;height:16px;width:16px;display:block}
      .ticker-controls li a{border:0px!important; padding:0px!important;}
      .ticker-controls li.jnt-play-pause,.ticker-controls li.jnt-play-pause.paused,.ticker-controls li.jnt-play-pause.paused.over,.ticker-controls li.jnt-prev,.ticker-controls li.jnt-play-pause.over,.ticker-controls li.jnt-next{position:absolute;background:none}
      .ticker-controls li.jnt-play-pause:after,.ticker-controls li.jnt-play-pause.over:after{content:"\f04c";font-size:13px;color:#71db00;font-family:fontAwesome;position:relative;left:1.8em}
      .ticker-controls li.jnt-play-pause.paused:after,.ticker-controls li.jnt-play-pause.paused.over:after{content:"\f04b";font-size:13px;color:#71db00;font-family:fontAwesome;position:relative;left:1.8em}
      .ticker-controls li.jnt-prev:after{content:"\f04a";font-size:13px;color:#71db00;font-family:fontAwesome;position:relative;left:0}
      .ticker-controls li.jnt-next:after{content:"\f04e";font-size:13px;color:#71db00;font-family:fontAwesome;position:relative;left:3.6em}
      .ticker .iauthor:before, .ticker .icomments:before, .ticker .idate:before{font-family:fontAwesome;position:relative;padding-right:8px;color:#fff}
      .ticker .iauthorpic{width:17px!important;height:17px!important;border-radius:50%;float:none;display:inline-block!important;margin-right:3px;position:relative;
      top: 6px;border: 1px solid #eeeeee;
          -moz-box-shadow: 1px 1px 5px rgba(0, 0, 0, .1);
          -webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, .1);
          box-shadow: 1px 1px 5px rgba(0, 0, 0, .1);
          padding: 3px;
      }
      .ticker span {padding-right:5px; font-family:Oswald; font-weight:normal}
      .ticker .icomments a{color:#71db00;font-size:11px}
      .ticker .icomments a:hover{text-decoration:underline}
      .ticker .icomments:before{content:'\f086';padding:0 3px 0 0px;color:#777;position:relative; top:-1px}
      .ticker .idate{font-size:11px;padding-right:7px;}
      .ticker .idate:before{content:'\f073';padding:0 5px;color:#777; position:relative; top:-1px}
      .ticker .mbttitle{font-family:oswald;font-size:14px;color:#71db00!important;font-weight:400;text-decoration:none;}
      .ticker .mbttitle:hover{text-decoration:underline}

      /*------ CSS3 Tooltip by MBT -------------*/
      .ticker .tooltip{outline:none;text-decoration:none!important;position:relative}
      .ticker .tooltip strong{line-height:30px}
      .ticker .tooltip > span{width:290px; white-space: normal; padding:15px 15px 0px 15px;opacity:0;top:170%;visibility:hidden;z-index:10;position:absolute;font-family:Arial;font-size:12px;font-style:normal;border-radius:2px;box-shadow:2px 2px 5px #999;-webkit-transition-property:opacity,margin-top,visibility,margin-left;-webkit-transition-duration:0.4s,0.3s,0.4s,.3s;-webkit-transition-timing-function:ease-in-out,ease-in-out,ease-in-out,ease-in-out;transition-property:opacity,margin-top,visibility,margin-left;transition-duration:0.4s,0.3s,0.4s,.3s;transition-timing-function:ease-in-out,ease-in-out,ease-in-out,ease-in-out}
      .ticker .tooltip > span img{float:right;width:130px;margin:0 0 30px 10px;padding: 0;border: none;}
      .ticker .tooltip:hover > span{opacity:1;text-decoration:none;visibility:visible;overflow:visible;display:inline;margin-left:0px}
      .ticker .tooltip span b{width:15px;height:15px;margin-left:20px;bottom:-9px;display:block;position:absolute;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);display:none\0/;*display:none}
      .ticker .tooltip > span{color:#fff; background:#71db00;border:1px solid #94fb26}
      .ticker .tooltip span b{margin-top:-19px;top:10px;background:#71db00;border-top:1px solid #94fb26;border-right:1px solid #94fb26;border-bottom:1px solid #71db00;border-left:1px solid #71db00}

      @media only screen and (max-width:480px) {
      .ticker-content {margin-left: -5px!important;padding-top: 4px!important;}.ticker-title{font-size:10px!important;padding:5px!important;}
      .ticker-controls, .ticker .icomments, .ticker .idate, .ticker .iauthor, .ticker .iauthorpic, .ticker-title:after {display:none;}}

      Make these custom changes

      • To change the green color theme of the News Ticker simply replace the green highlighted color codes with color of your choice. Use our  Color Code Generator.
    6. Save your template.
    7. Now go to Blogger > Layout
    8. Select "Add a Gadget"
    9. Choose "HTML/JavaScript" gadget
    10. Keep the title field empty and then paste the following code inside it:
             

      <!-- ######### Headlines News Widget By MBT ############# -->

      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
      <script src="http://www.jquerynewsticker.com/includes/jquery.ticker.js" type="text/javascript"></script>

      <!-- ######### Writing Callback Function ############# -->
      <script type="text/javascript">
      //----------------------------Defaults
      var ListBlogLink = "http://www.mybloggertricks.com";
      var ListCount = 5;
      var TitleCount = 70;
      var ListLabel ="Widgets";
      var ChrCount = 140;
      var ImageSize = 200;

      //----------------------------Function Start
      function mbtlist(json) {
      document.write('<ul id="js-news" class="js-hidden">');
      for (var i = 0; i < ListCount; i++)
      {

      //-----------------------------Variables Declared
      var listing= ListImage = ListUrl = ListTitle = ListImage = ListContent = ListConten = ListAuthor = ListTag = ListDate = ListUpdate = ListComments = thumbUrl = TotalPosts = sk = AuthorPic= ListMonth = Y = D = M = m = YY = DD = MM = mm = TT =  "";
      //----------------------------- Title URL
      for (var j = 0; j < json.feed.entry[i].link.length; j++) {
      if (json.feed.entry[i].link[j].rel == 'alternate') {
      break;
      }
      }
      ListUrl= "'" + json.feed.entry[i].link[j].href + "'";
      //----------------------------------- Title Stirng
      if (json.feed.entry[i].title!= null)
      {
      ListTitle= json.feed.entry[i].title.$t.substr(0, TitleCount);
      }

      if (json.feed.entry[i].thr$total)
      {
      ListComments= "<a href='"+json.feed.entry[i].link[j].href+"#comment-form'>"+json.feed.entry[i].thr$total.$t+"</a>";
      }
      ListAuthor= json.feed.entry[i].author[0].name.$t.split(" ");
      ListAuthor=ListAuthor.slice(0, 1).join(" ");
      AuthorPic = json.feed.entry[i].author[0].gd$image.src;


      //################### Content Check
      ListConten = json.feed.entry[i].content.$t;
      ListContent= ListConten.replace(/(<([^>]+)>)/ig,"").substring(0, ChrCount);

      //################### Date Format

      ListMonth= ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

      ListDate= json.feed.entry[i].published.$t.substring(0,10);

                               Y = ListDate.substring(0, 4);
                              m = ListDate.substring(5, 7);
                               D = ListDate.substring(8, 10);
                               M = ListMonth[parseInt(m - 1)]; 

      //################### Thumbnail Check
      if (json.feed.entry[i].media$thumbnail)
      {
      thumbUrl = json.feed.entry[i].media$thumbnail.url;
      sk= thumbUrl.replace("/s72-c/","/s"+ImageSize+"/");
      ListImage= "'" + sk.replace("?imgmax=800","") + "'";
      }

      // YouTube scan
      else if (json.feed.entry[i].content.$t.match(/youtube\.com.*(\?v=|\/embed\/)(.{11})/) != null)
      {
          var youtube_id = json.feed.entry[i].content.$t.match(/youtube\.com.*(\?v=|\/embed\/)(.{11})/).pop();
         
          if (youtube_id.length == 11) {
              var ListImage = "'//img.youtube.com/vi/"+youtube_id+"/0.jpg'";
              }
      }


      else if (json.feed.entry[i].content.$t.match(/src=(.+?[\.jpg|\.gif|\.png]")/) != null)
      {
      // Support For 3rd Party Images
      ListImage =  json.feed.entry[i].content.$t.match(/src=(.+?[\.jpg|\.gif|\.png]")/)[1];
      }
      else
      {
      ListImage= "'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyikwojFj75NhjpfZNfB6sTWKfZy_I-wSv7VrSbLTipRCMjp2hrNFivmZqfjbXKdcmYVt-xNMeze7mv9eDlCiNaid15QrD_dnUYIN7pxFJs520P3kbedtlw1fITPr56DJN25UHxtcEwaM/s200/Icon.png'";
      }

      //----------------------------------- Printing List
      var listing = "<li class='news-item'><span class='iauthor'><img class='iauthorpic' src='"+AuthorPic+"'/>"
      +ListAuthor+ "</span> <span class='icomments'>"
      +ListComments + "</span>  <span class='idate'>"
      + D + " " + M + "</span><i class='fa fa-chevron-right'></i> <a class='mbttitle tooltip' href="
      +ListUrl+
      "><span><b></b><img src="
      +ListImage+
      "/>"
      +ListContent+
      " →</span>"+ListTitle+"</a></li>";
      document.write(listing);
      }}

      document.write("</ul><script src='"+ListBlogLink+"/feeds/posts/default/-/"+ListLabel+"?alt=json-in-script&callback=mbtlist'></"+"script>");
      /*##########Newsticker settings########*/
          $(function () {
              $('#js-news').ticker({
              speed: 0.20,
              controls: true,  
              titleText: 'Headlines',
              displayType: 'reveal',
              pauseOnItems: 2000});
      });
      </script>

      Make these changes:

      • ListBlogLink : Insert your Blog URL here
      • ListCount : Decide how many headlines do you wish to display.
      • TitleCount : Choose how many characters to display in post title length.
      • ListLabel : Insert your blog label here. Remember that labels are case sensitive. Therefore type it exactly as it is shown in your browser address bar. News Ticker will not work if label case is not correct. 
      • ChrCount : Set the length of post description here.
      • ImageSize : Set image resolution (aspect ratio) here.
      • speed: Edit this value (0.20) to increase or decrease the scroll speed.
      • controls: Set true to false if you wish to hide the control buttons i.e. Play/Pause, Next/Previous
      • titleText: Set the News Ticker title here from Headlines to anything you like such as Latest, Hottest etc.
      • displayType: There are two types of scrolling text animation, reveal or fade. Set it as per your preference.
      • If you want to show latest posts headlines of your blog without mentioning any specific label/category then simply remove /-/"+ListLabel+" from the code above.
    11. Click Save button and you are all done.

    Enjoy showing animated plus scrolling news headlines to your visitors! :)

    Facing Problems Installing Headlines News Widget?

    I tried keeping these steps as simple as possible but if in case you are facing problems in any step please feel free to post your queries below. I would love to help as soon as time allows.

    I hope this cool headline news  ticker may help you in generating extra pageviews and creating better user engagement. If you liked this plugin and want a similar plugin to be developed for wordPress blogs using the WP rest API, then please post your comments below.

    Have a great day buddies! =)

    Thursday

    Breaking News Ticker Widget For Blogger - JSON Feeds Support!

    Breaking News Ticker Widget For blogger

    Breaking News widget for Blogger blogs is a free, flat, stylish, modern, easy to use and responsive Blogger jQuery news ticker. It displays text-based titles of your latest posts in a scrolling fashion automatically. It is the best way to showcase your hottest content to your website visitors on your homepage just how BBC or CNN does it! We have coded it using Blogger JSON Feeds API and jQuery News Ticker plugin.

    UPDATE: Check Headline News Ticker With ToolTips!

    Some sites like codecanyon are selling News Ticker Plugins at $5, but you will not only get it free at MBT but you will also learn how such widgets are coded if you read our JSON Feeds series.

    Instead of using RSS Feeds to built a scrolling newsticker, we will use JSON Feeds to create a more advanced, lightweight and dynamic News Ticker that will not only just display titles but will also show almost every info (i.e. Avatar/Comments/Published date) about your blog post.

    What is a News Ticker?

    A news ticker is a primarily horizontal, text-based display. Most tickers are traditionally displayed in the form of scrolling text running from right to left across the screen. This term originally refers to Television News tickers, scrolling near the bottom of the TV screen. The TV news ticker allows breaking news to be shown to the viewer without interrupting the current broadcast. Similarly webmasters have adopted a similar method of displaying latest news on their websites homepage. The latest headlines of your websites or blog is shown scrolling from left to right across the width of the site to keep visitors informed about most updated content.

    In short it is a simple, handy widget that helps you to showcase your website's latest headlines, latest updates or featured content from a specific category.

    Features of Breaking News Ticker Widget:

    Blogger News Ticker is an advanced widget equipped with these features:

    • Author Avatar - Unique!
    • Displays latest posts dynamically. - Unique!
    • Displays recent posts from a specific category/label.
    • Scrolling text with two animations: reveal & fade
    • Clickable Comments Count
    • Custom Date Format - Unique!
    • Title Length is adjustable
    • Fully Customizable - Multi Colors!
    • Responsive and mobile friendly. 
    • Controls Navigation. Play/Pause, Next/Previous
    • Support all browsers: Firefox, Chrome, IE, Safari etc.
    • Many more!

    How To add News Ticker Widget In Blogger?

    To add news ticker widget in your blogger templates, please follow these easy steps:

    1. Go To Blogger > Template
    2. Backup your template
    3. Click "Edit HTML"
    4. Just below <head> tag paste the following JS and CSS source links:

      <link href='http://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css' rel='stylesheet'/>
      <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'/>

    5. Next search ]]></b:skin> and just above it paste the following code:

      /*########Default Newsticker Styles#########*/

      .ticker-wrapper.has-js{margin:20px 0;padding:0 20px;width:780px;height:32px;display:block;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;background-color:#f8f0db;font-size:.75em}
      .ticker{width:710px;height:23px;display:block;position:relative;overflow:hidden;background-color:#f8f0db}
      .ticker-title{padding-top:9px;color:#900;font-weight:700;background-color:#f8f0db;text-transform:uppercase}
      .ticker-content{margin:0;padding-top:9px;position:absolute;color:#1F527B;font-weight:700;background-color:#f8f0db;overflow:hidden;white-space:nowrap;line-height:1.2em}
      .ticker-content a{text-decoration:none;color:#1F527B}
      .ticker-content a:hover{text-decoration:underline;color:#0D3059}
      .ticker-swipe{padding-top:9px;position:absolute;top:0;background-color:#f8f0db;display:block;width:800px;height:23px}
      .ticker-swipe span{margin-left:1px;background-color:#f8f0db;border-bottom:1px solid #1F527B;height:12px;width:7px;display:block}
      .ticker-controls{padding:8px 0 0;list-style-type:none;float:left}
      .ticker-controls li{padding:0;margin-left:5px;float:left;cursor:pointer;height:16px;width:16px;display:block}
      .ticker-controls li.jnt-play-pause{background-image:url(../images/controls.png);background-position:32px 16px}
      .ticker-controls li.jnt-play-pause.over{background-position:32px 32px}
      .ticker-controls li.jnt-play-pause.down{background-position:32px 0}
      .ticker-controls li.jnt-play-pause.paused{background-image:url(../images/controls.png);background-position:48px 16px}
      .ticker-controls li.jnt-play-pause.paused.over{background-position:48px 32px}
      .ticker-controls li.jnt-play-pause.paused.down{background-position:48px 0}
      .ticker-controls li.jnt-prev{background-image:url(../images/controls.png);background-position:0 16px}
      .ticker-controls li.jnt-prev.over{background-position:0 32px}
      .ticker-controls li.jnt-prev.down{background-position:0 0}
      .ticker-controls li.jnt-next{background-image:url(../images/controls.png);background-position:16px 16px}
      .ticker-controls li.jnt-next.over{background-position:16px 32px}
      .ticker-controls li.jnt-next.down{background-position:16px 0}
      .js-hidden{display:none}
      .no-js-news{padding:10px 0 0 45px;color:#F8F0DB}
      .left .ticker-controls,.left .ticker-content,.left .ticker-title,.left .ticker{float:left}
      .left .ticker-controls{padding-left:6px}
      .right .ticker-controls,.right .ticker-content,.right .ticker-title,.right .ticker{float:right}
      .right .ticker-controls{padding-right:6px}

      /*########Blogger Newsticker by MBT#########*/
      .ticker-wrapper.has-js{margin:0;padding:0;width:98%;height:42px;display:block;border-radius:0;background-color:#fff;border:1px solid #eee;font-size:12px}
      .ticker{width:80%;height:42px;display:block;position:relative;overflow:hidden;background-color:#fff}
      .ticker-title{background:#71db00;padding:10px;color:#FFF;font-size:16px;font-family:oswald;text-transform:uppercase;text-shadow:1px 1px 6px #666}
      .ticker-title:after{left:76px;top:10px;height:0;width:0;position:absolute;content:" ";pointer-events:none;margin-left:0;margin-top:1px;border-left:13px solid #71db00;border-top:10px solid transparent;border-bottom:10px solid transparent;-moz-transform:scale(.9999)}
      .ticker-content{background-color:#fff;margin-left:15px;color:#444;margin-top:1px}
      .ticker-swipe{background-color:#fff;position:relative;top:5px;left:100px!important}
      .ticker-swipe span{margin-left:1px;background-color:#fff;border-bottom:1px solid #333;height:12px;width:7px}
      .ticker-controls{padding:0!important;margin:13px 0 0 10px !important;list-style-type:none;position:relative;right:-50px}
      .ticker-controls li{padding:0;margin-left:5px;float:left;cursor:pointer;height:16px;width:16px;display:block}
      .ticker-controls li a{border:0!important;padding:0!important}
      .ticker-controls li.jnt-play-pause,.ticker-controls li.jnt-play-pause.paused,.ticker-controls li.jnt-play-pause.paused.over,.ticker-controls li.jnt-prev,.ticker-controls li.jnt-play-pause.over,.ticker-controls li.jnt-next{position:absolute;background:none}
      .ticker-controls li.jnt-play-pause:after,.ticker-controls li.jnt-play-pause.over:after{content:"\f04c";font-size:13px;color:#71db00;font-family:fontAwesome;position:relative;left:1.8em}
      .ticker-controls li.jnt-play-pause.paused:after,.ticker-controls li.jnt-play-pause.paused.over:after{content:"\f04b";font-size:13px;color:#71db00;font-family:fontAwesome;position:relative;left:1.8em}
      .ticker-controls li.jnt-prev:after{content:"\f04a";font-size:13px;color:#71db00;font-family:fontAwesome;position:relative;left:0}
      .ticker-controls li.jnt-next:after{content:"\f04e";font-size:13px;color:#71db00;font-family:fontAwesome;position:relative;left:3.6em}
      .ticker .iauthor:before,.ticker .icomments:before,.ticker .idate:before{font-family:fontAwesome;position:relative;padding-right:8px;color:#fff}
      .ticker .iauthorpic{width:16px!important;height:16px!important;border-radius:50%;float:none;display:inline-block!important;margin:0;padding-right:3px;position:relative;top:3px}
      .ticker span{padding-right:5px;font-family:Oswald;font-weight:400}
      .ticker .icomments a{color:#71db00;font-size:11px}
      .ticker .icomments a:hover{text-decoration:underline}
      .ticker .icomments:before{content:'\f086';padding:0 3px 0 0;color:#777;position:relative;top:-1px}
      .ticker .idate{font-size:11px;padding-right:7px}
      .ticker .idate:before{content:'\f073';padding:0 5px;color:#777;position:relative;top:-1px}
      .ticker .mbttitle{font-family:oswald;font-size:14px;color:#71db00!important;font-weight:400;text-decoration:none}
      .ticker .mbttitle:hover{text-decoration:underline}

      Make these changes

      • To change the green color theme of the News Ticker simply replace the green highlighted color codes with color of your choice. The color can be in rgb or #hexadecimal, both work. Use our  Color Code Generator.
    6. Save your template.
    7. Now go to Blogger > Layout
    8. Select "Add a Gadget"
    9. Choose "HTML/JavaScript" gadget
    10. Keep the title field empty and then paste the following code inside it:

      <!-- ######### Breaking News Ticker By MBT ############# -->

      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script><script src="http://www.jquerynewsticker.com/includes/jquery.ticker.js" type="text/javascript"></script>
      <script type="text/javascript">
      //----------------------------Defaults
      var ListBlogLink = "http://www.mybloggertricks.com";
      var ListCount = 5;
      var TitleCount = 70;
      var ListLabel = "Widgets";

      //----------------------------Function Start
      function mbtlist(json) {
      document.write('<ul id="js-news" class="js-hidden">');
      for (var i = 0; i < ListCount; i++)
      {

      //-----------------------------Variables Declared
      var listing= ListImage = ListUrl = ListTitle = ListImage = ListContent = ListConten = ListAuthor = ListTag = ListDate = ListUpdate = ListComments = thumbUrl = TotalPosts = sk = AuthorPic= ListMonth = Y = D = M = m = YY = DD = MM = mm = TT =  "";
      //----------------------------- Title URL
      for (var j = 0; j < json.feed.entry[i].link.length; j++) {
      if (json.feed.entry[i].link[j].rel == 'alternate') {
      break;
      }
      }
      ListUrl= "'" + json.feed.entry[i].link[j].href + "'";
      //----------------------------------- Title Stirng
      if (json.feed.entry[i].title!= null)
      {
      ListTitle= json.feed.entry[i].title.$t.substr(0, TitleCount);
      }

      if (json.feed.entry[i].thr$total)
      {
      ListComments= "<a href='"+json.feed.entry[i].link[j].href+"#comment-form'>"+json.feed.entry[i].thr$total.$t+"</a>";
      }
      ListAuthor= json.feed.entry[i].author[0].name.$t.split(" ");
      ListAuthor=ListAuthor.slice(0, 1).join(" ");
      AuthorPic = json.feed.entry[i].author[0].gd$image.src;

      //################### Date Format

      ListMonth= ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

      ListDate= json.feed.entry[i].published.$t.substring(0,10);

                               Y = ListDate.substring(0, 4);
                              m = ListDate.substring(5, 7);
                               D = ListDate.substring(8, 10);
                               M = ListMonth[parseInt(m - 1)]; 
      //----------------------------------- Printing List
      var listing = "<li class='news-item'><span class='iauthor'><img class='iauthorpic' src='"+AuthorPic+"'/>"
      +ListAuthor+ "</span> <span class='icomments'>"
      +ListComments + "</span>  <span class='idate'>"
      + D + " " + M + "</span><i class='fa fa-chevron-right'></i> <a class='mbttitle' href="
      +ListUrl+
      "target='_blank'>"
      +ListTitle+
      "</a></li>";
      document.write(listing);
      }
      }
      document.write("</ul><script src='"+ListBlogLink+"/feeds/posts/default/-/"+ListLabel+"?alt=json-in-script&callback=mbtlist'></"+"script>");

      /*##########Breaking News Ticker Settings########*/
          $(function () {
              $('#js-news').ticker({
              speed: 0.20,
              controls: true,  
              titleText: 'Hottest',
              displayType: 'reveal',
              pauseOnItems: 2000,   
      });
      });
      </script>

      Make these changes:

      • ListBlogLink : Insert your Blog URL here
      • ListCount : Decide how many breaking titles do you wish to display.
      • TitleCount : Choose how many characters to display in post title length.
      • ListLabel : Insert your blog label here. Remember that labels are case sensitive. Therefore type it exactly as it is shown in your browser address bar. News Ticker will not work if label case is not correct. Edit "Widgets"
      • speed: Edit this value (0.20) to increase or decrease the scroll speed.
      • controls: Set true to false if you wish to hide the control buttons i.e. Play/Pause, Next/Previous
      • titleText: Set the News Ticker title here from Hottest to anything you like such as Latest, Breaking etc.
      • displayType: There are two types of scrolling text animation, reveal or fade. Set it as per your preference.
      • TitleCount : Choose how many characters to display in post title.
      • If you want to show latest posts headlines of your blog without mentioning any specific label/category then simply remove /-/"+ListLabel+" from the code above. 
    11. Click Save button and you are all ready to start showing animated plus scrolling headlines to your readers! :)

    Do You Need Any Help?

    The installation steps above are made extremely simple. You just need to follow it carefully especially taking care of the label case sensitivity and also the jQuery file. Let me know if you need any help. I would love to assist you as soon as time allows.

    I really appreciate when you share your feedback.  Please let us know how useful was this tutorial for you and how can this cool headline news widget for blogger help you to better engage your readers and increase your pageviews. Would be waiting to hear from you.

    The next tutorial will be based on adding a tooltip to this scrolling headlines news ticker widget for displaying Image Thumbnail plus description snippet, it would be an amazing enhancement to the current design, so stay tuned for updates! :)

    Friday

    Create Random Post Slider Widget For BlogSpot Blogs!

    Create Random Post Slider For Blogspot blogsEver wondered you could display images randomly inside a blogger slider? So far we have shared dynamic recent posts slider and a static slider, today for the first time online, we are releasing a Random Post Slider for BlogSpot blogs which is built using Blogger JSON Feeds API, FlexSlider and jQuery. A fully responsive image slider that will automatically display your random posts on your homepage or sidebar, almost anywhere you want.  Lets learn how to create a random slider for blogspot in simple steps but before that lets see a live demo!

    What is Blogger Random Post Slider Widget?

    Due to the natural structure of blogging platforms such as blogspot, articles end up being buried down once they get old. New users often avoid navigating through all your labels/categories, as a result most of your best content receives no attention at all. A random post slider is the best way to showcase your oldest posts to your visitors. The slider widget will pick your old posts randomly and automatically display the thumbnails either on homepage or sidebar depending on what location best suits you. The slider rotates in a clockwise direction where each slide is both responsive and dynamic.

    Features of Blogger Random Post Slider Widget

    Each slide will display useful data which is fetched using a JSON Call. Features supported include:

    • Article comments count,
    • Author avatar,
    • Author name,
    • Published date,
    • Labels,
    • Featured Thumbnail,
    • Third Party Thumbnail Support,
    • YouTube Thumbnail Support,
    • Editable Title,
    • Mobile responsive (Smartphones/ Tablets/ Laptops/ Desktop Screens supported)

    Create and Random Post Slider in Blogger

    Follow these easy steps:

    1. Go To Blogger > Template
    2. Backup your template
    3. Click "Edit HTML"
    4. Just below <head> tag paste the following JS and CSS source links:

      <script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'></script>
      <link href='http://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css' rel='stylesheet'/>
      <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'/>
      <link href='https://cdnjs.cloudflare.com/ajax/libs/flexslider/2.6.1/flexslider.min.css' rel='stylesheet' type='text/css'/>
      <script src='https://cdnjs.cloudflare.com/ajax/libs/flexslider/2.6.1/jquery.flexslider.min.js' type='text/javascript'></script>

      Note: Do not add JQuery, FontAwesome, FlexSlider or Oswald source links to your template if you are already using them on your site.

    5. Next search ]]></b:skin> and just above/before it paste the following code:

      /*######### Random Posts By MyBloggerTricks #############*/
      .mbt-random{margin:0 5px;border:0;width:100%;overflow:hidden}
      .mbt-random .slides{list-style-type:none;margin:0 auto;padding:0}
      .mbt-random li{color:#fff;font-family:helvetica;font-size:12px;overflow:hidden;padding-top:10px}
      .mbt-random .flex-control-nav li{display:inline-block;margin:0 2px}
      .mbt-random .flex-control-nav a{text-indent:9999px;display:block;width:10px;cursor:pointer;height:10px;background-color:#000;border:1px solid #000;border-radius:0!important}
      .flex-direction-nav .flex-prev{left:-50px}
      .flex-direction-nav .flex-next{right:-50px;text-align:right}
      .mbt-random .flex-control-paging{display:none}
      .flex-direction-nav{position:relative;top:-250px}
      .mbt-random .flex-control-nav a.flex-active{background-color:#84db06;border:1px solid #90f128}
      .mbt-random .flex-div{margin:0 auto;display:block;padding:0!important;position:relative;height:370px}
      .mbt-random li a{color:#0080ff;text-decoration:none}
      .mbt-random i{color:#999;padding-right:5px}
      .mbt-random .iline{line-height:2em;margin:0;position:relative;top:-90px;background:#56adff;padding:3px 10px;display:inline-block}
      .mbt-random .icontent{line-height:1.5em;margin-top:5px}
      .mbt-random div span{margin:0 5px 0 0;display:inline-block;font-weight:400}
      .mbt-random .mbttitle{font-family:oswald;font-size:20px;color:#fff;font-weight:400;text-decoration:none;position:relative;top:-90px;background:#66b5ff;padding:15px 10px;display:block}
      .mbt-random .mbttitle:hover,.mbt-random .itotal a:hover{color:#fff;text-decoration:none}
      .mbt-random .iedit a{text-decoration:none;color:#999;cursor:pointer}
      .mbt-random .iedit:before,.mbt-random .iauthor:before,.mbt-random .itag:before,.mbt-random .icomments:before,.mbt-random .idate:before,.mbt-random .itotal span:before{font-family:fontAwesome;position:relative;padding-right:8px;color:#fff}
      .mbt-random .iauthorpic{width:17px!important;height:17px!important;border-radius:50%;float:none;display:inline-block!important;margin:0;padding-right:3px;position:relative;top:3px}
      .mbt-random .iFeatured{overflow:hidden;position:relative;margin:0;padding:0;width:100%}
      .mbt-random .iFeatured a{background:none;padding:0;display:block;border:0px solid #eee;margin:0 -1px}
      .mbt-random .iFeatured img{height:305px!important;-moz-transition:all .3s;-webkit-transition:all .3s;transition:all .3s;border-radius:0;margin:0;padding:0;opacity:.7}
      .mbt-random .iFeatured:hover img{opacity:1;-moz-transform:scale(1.4);-webkit-transform:scale(1.4);transform:scale(1.4)}
      .mbt-random .icomments a, .mbt-random .itag a{color:#0080ce;font-family:arial;font-size:12px}
      .mbt-random .icomments a:hover, .mbt-random .itag a:hover{text-decoration:underline}
      .mbt-random .itag:before{content:'\f02c';padding:0 3px 0 7px;color:#fff}
      .mbt-random .icomments:before{content:'\f086';padding:0 3px 0 7px;color:#fff}
      .mbt-random .idate{color:#fff;padding:3px 4px;font-family:arial;font-size:11px}
      .mbt-random .idate:before{content:'\f073';padding:0 5px;color:#fff}

    6. Make these changes

      • To change the blue background color behind the title edit: #66b5ff
      • To change the light blue background behind Author name edit: #56adff
      • To change the white color of the Title text edit: #fff
      • To change the color of the comment and labels link edit: #0080ce
    7. Save your template.
    8. Now go to Blogger > Layout
    9. Select "Add a Gadget"
    10. Choose "HTML/JavaScript" gadget
    11. Keep the title field empty and then paste the following code inside it:

      <script type="text/javascript">
      //################### Defaults
      var ListBlogLink = "http://mybloggertricks.com";
      var ListCount = 4; 
      var TitleCount = 66;
      var ImageSize = 800;

      $(window).load(function() {
        $('.mbt-random').flexslider({
         animation: "slide",
          itemWidth: 600,
      itemMargin: 25,
        directionNav: true,
             touch: true,
             slideshowSpeed: 2500,
            pauseOnHover: true,
           animationSpeed: 700,
        });
      });

      var RandomArray = [];
      var TotalPosts  = 0;
      var RandomArray = new Array(ListCount);
      function TotalCount(json) {
          TotalPosts   = json.feed.openSearch$totalResults.$t
      }
      document.write('<script type=\"text/javascript\" src=\"'+ListBlogLink+'/feeds/posts/default?alt=json-in-script&callback=TotalCount\"><\/script>');

      function GenerateNum() {
          for (var i = 0; i < ListCount ; i++) {
          for (var j = 0; j < RandomArray.length; j++){
          var RandomNum = Math.floor(Math.random() * (TotalPosts ) + 1);
          RandomArray[i] = RandomNum; }
                                                                        }
      }

      </script>

      <div class="flexslider mbt-random">
      <ul class="slides">
      <script type="text/javascript">
      //################### Function Start
      function mbtrand(json) {
      for (var i = 0; i < json.feed.entry.length; i++)
      { 
      //################### Variables Declared
      var listing= ListImage = ListUrl = ListTitle = ListImage = ListContent = ListConten = ListAuthor = ListTag = ListDate = ListUpdate = ListComments = thumbUrl = TotalPosts = sk = AuthorPic= ListMonth = Y = D = M = m = YY = DD = MM = mm = TT =  "";
      //################### Category

      if (json.feed.entry[i].category != null)
      {
      for (var k = 0; k < json.feed.entry[i].category.length; k++) {
      ListTag += "<a href='"+ListBlogLink+"/search/label/"+json.feed.entry[i].category[k].term+"'>"+json.feed.entry[i].category[k].term+"</a>";
      if(k < json.feed.entry[i].category.length-1)
      { ListTag += ", ";}
      }
      }
      //################### URL
      for (var j = 0; j < json.feed.entry[i].link.length; j++) {
            if (json.feed.entry[i].link[j].rel == 'alternate') {
              break;
            }
          }
      ListUrl= "'" + json.feed.entry[i].link[j].href + "'";
      //################### Info
      TotalPosts = json.feed.openSearch$totalResults.$t;
      if (json.feed.entry[i].title!= null)
      {
      ListTitle= json.feed.entry[i].title.$t.substr(0, TitleCount);
      }
      if (json.feed.entry[i].thr$total)
      {
      ListComments= "<a href='"+json.feed.entry[i].link[j].href+"#comment-form'>"+json.feed.entry[i].thr$total.$t+"</a>";
      }
      ListAuthor= json.feed.entry[i].author[0].name.$t.split(" ");
      ListAuthor=ListAuthor.slice(0, 1).join(" ");
      AuthorPic = json.feed.entry[i].author[0].gd$image.src;
      //################### Date Format
      ListMonth= ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
      ListDate= json.feed.entry[i].published.$t.substring(0,10);
                               Y = ListDate.substring(0, 4);
                              m = ListDate.substring(5, 7);
                               D = ListDate.substring(8, 10);
                               M = ListMonth[parseInt(m - 1)];                      
      ListUpdate= json.feed.entry[i].updated.$t.substring(0, 16);
                               YY = ListUpdate.substring(0, 4);
                              mm = ListUpdate.substring(5, 7);
                               DD = ListUpdate.substring(8, 10);
                               TT = ListUpdate.substring(11, 16);
                               MM = ListMonth[parseInt(mm - 1)];  
      //################### Thumbnail Check

      if (json.feed.entry[i].media$thumbnail)
      {
      thumbUrl = json.feed.entry[i].media$thumbnail.url;
      sk= thumbUrl.replace("/s72-c/","/s"+ImageSize+"/");
      ListImage= "'" + sk.replace("?imgmax=800","") + "'";
      }

      // YouTube scan
      else if (json.feed.entry[i].content.$t.match(/youtube\.com.*(\?v=|\/embed\/)(.{11})/) != null)
      {
          var youtube_id = json.feed.entry[i].content.$t.match(/youtube\.com.*(\?v=|\/embed\/)(.{11})/).pop();
         
          if (youtube_id.length == 11) {
              var ListImage = "'//img.youtube.com/vi/"+youtube_id+"/0.jpg'";
              }
      }

      else if (json.feed.entry[i].content.$t.match(/src=(.+?[\.jpg|\.gif|\.png]")/) != null)
      {
      // Support For 3rd Party Images
      ListImage =  json.feed.entry[i].content.$t.match(/src=(.+?[\.jpg|\.gif|\.png]")/)[1];
      }
      else
      {
      ListImage= "'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyikwojFj75NhjpfZNfB6sTWKfZy_I-wSv7VrSbLTipRCMjp2hrNFivmZqfjbXKdcmYVt-xNMeze7mv9eDlCiNaid15QrD_dnUYIN7pxFJs520P3kbedtlw1fITPr56DJN25UHxtcEwaM/s200/Icon.png'";
      }
      //###################  Printing List
      var listing = "<li><div class='flex-div'><div class='iFeatured'><a  href="
      + ListUrl+
        "><img src="
      +ListImage+
      "/></a></div><div class='iline'><span class='iauthor'><img class='iauthorpic' src='"+AuthorPic+"'/>"
      +ListAuthor+
      "</span><span class='icomments'>"
      +ListComments +
      "</span> <span class='idate'>"
      + D +
      " "
      + M +
      "</span><span class='itag'>"
      +ListTag +
      "</span></div><a class='mbttitle' href="
      +ListUrl+
      "target='_blank'>"
      +ListTitle+
      "</a></div></li>";

      document.write(listing);

      } }
      <!-- #### Invoking the Callback Function #### -->
      for (var i = 0; i < ListCount ; i++) {
      GenerateNum();
      var scripta = '<script type=\"text/javascript\" src=\"'+ListBlogLink+'/feeds/posts/default?alt=json-in-script&start-index='+RandomArray[i] + '&max-results=1&callback=mbtrand\"><\/script>';
      document.write(scripta);
      };

      </script>
      </ul></div>

      Make these changes to customize the slider:

      • Place your blog URL inside ListBlogLink
      • Inside ListCount  mention how many slides to display. I recommend not displaying more than 3 or 4 slides. Increasing this number will increase the number of iterations/loops and thus slowing down your site.
      • Inside TitleCount  mention the length of title characters to display. By default titles longer than 66 characters will be trimmed.
      • Inside ImageSize mention the aspect ratio or resolution of your featured thumbnails. By default the thumbnails will be 800px in width. If you wish to display the slider in sidebar only then you can decrease this value to 400px.
    12. Click Save and you are all done!

    You have now successfully created blogger random post slider and have installed it on your blog template. Visit your blog to see it working just fine. If in case you troubleshoot yourself, feel free to leave your comments below and I would love to help you with all your queries.

    I have installed a random post widget on my blog slider and so far it has really helped growing our audience. I wish this slider may help you equally. This is the first random slider widget of its kind published online for blogger blogs therefore do let us know how useful is this slider for you and what is your experience after installing it successfully on your template. Peace buddies! :)

    If you are interested to learn how are blogger widgets developed and coded then do read: