Add New Breaking News Widget in Blogger 2016

How to Add Breaking News Feed in Bloggers - in this Tutorail You See How to Add Breaking New Widget With Awesome Look.

ADD NEW BREAKING NEWS WIDGET IN BLOGGER

HOW TO ADD BREAKING NEWS IN BLOGGER

In this Widget You Get Recent Post Breaking New in Blogger. Its Very Awesome and Cool Widget . Ok Lets Start


Install Breaking News Widget in Blogger

First open Blogger> Template> Edit HTML Add the following code just before ]]> </b: skin> or 
</style>

/* CSS Breaking News */
#breakingnews {margin:15px 0 0 0;margin-right:15px;height:42px;line-height:29px;overflow:hidden;background:#fff;border:1px solid #e6e6e6;}
#breakingnews .breakhead {position:absolute;background:none repeat scroll 0 0 #363b40;color:#fff;display:block;float:left;font-family:inherit;font-size:16px;font-weight:400;text-transform:uppercase;padding:6.5px 22px;}
#adbreakingnews li a {font-family:inherit;font-weight:400;color:#666;margin-top:10px;transition:all 0.5s ease-in-out;}
#adbreakingnews li a:hover {color:#359bed;}
#adbreakingnews {float:left;margin-left:75px;margin-top:6px;}
#adbreakingnews ul,#adbreakingnews li{list-style:none;margin:0;padding:0}

@media only screen and (max-width:640px){
#breakingnews {margin:20px 0 0 0;margin-right:0;}
#breakingnews .breakhead {padding:6.5px 14px;}
#adbreakingnews {margin-left:50px;}}

Then add the following code before the closing </body>


<script type='text/javascript'>
//<![CDATA[
// Breaking News
$(document).ready(function(){var e="http://shouterways.com",t=20;$.ajax({url:""+e+"/feeds/posts/default?alt=json-in-script&max-results="+t,type:"get",dataType:"jsonp",success:function(e){function t(){$("#adbreakingnews li:first").slideUp(function(){$(this).appendTo($("#adbreakingnews ul")).slideDown()})}var n,r,s="",a=e.feed.entry;if(void 0!==a){s="<ul>";for(var l=0;l<a.length;l++){for(var o=0;o<a[l].link.length;o++)if("alternate"==a[l].link[o].rel){n=a[l].link[o].href;break}r=a[l].title.$t,s+='<li><a href="'+n+'" target="_blank">'+r+"</a></li>"}s+="</ul>",$("#adbreakingnews").html(s),setInterval(function(){t()},5e3)}else $("#adbreakingnews").html("<span>No result!</span>")},error:function(){$("#adbreakingnews").html("<strong>Error Loading Feed!</strong>")}})});
//]]>
</script>


Change http://shouterways.com with your blog address
then save the code below anywhere freely, apply within the body tags (Between the opening tag <body> and the closing tag </ body> )


<div id='breakingnews'><span class='breakhead'><i class='fa fa-rss'/></span>
<div id='adbreakingnews'>Loading...</div></div>

If you want to display the breaking news on the main page only, please wrap markup above with special conditional tag main page

<b:if cond='data:blog.pageType == &quot;index&quot;'>
<div id='breakingnews'><span class='breakhead'><i class='fa fa-rss'/></span>
<div id='adbreakingnews'>Loading...</div></div>
</b:if>

Finally save the template.

Post a Comment

Previous Post Next Post