Skip to main content

Add New Breaking News Widget for Blogger

Written explanation 
Step 1 : Adding to Template
1) Go to Blogger Dashboard → Template → Edit HTML.
2) Now Find the code shown below using [ctrl+F] (Use In HTML Box)
</body>
3) Now Paste the Code Shown Below just Before it.
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function () {
var url_blog = 'YOUR URL HERE', //replace with your Domain
    numpostx  = 10; //Posts want to display
$.ajax({
    url: '' + url_blog + '/feeds/posts/default?alt=json-in-script&max-results=' + numpostx + '',
    type: 'get',
    dataType: "jsonp",
    success: function(data) {
        var posturl, posttitle, skeleton = '',
            entry = data.feed.entry;
        if (entry !== undefined) {
            skeleton = "<ul>";
        for (var i = 0; i < entry.length; i++) {
                for (var j=0; j < entry[i].link.length; j++)
                {
                     if (entry[i].link[j].rel == "alternate")
                        {
                            posturl = entry[i].link[j].href;
                            break;
                         }
                }                posttitle = entry[i].title.$t;
            skeleton += '<li><a href="' + posturl + '" target="_blank">' + posttitle + '</a></li>';
        }
            skeleton += '</ul>';
            $('#recentpostbreaking').html(skeleton);
            // kode untuk efek pada breaking news
            function tick(){
            $('#recentpostbreaking li:first').slideUp( function () { $(this).appendTo($('#recentpostbreaking ul')).slideDown(); });
            }
        setInterval(function(){ tick () }, 5000);
        } else {
            $('#recentpostbreaking').html('<span>No result!</span>');
        }
    },
    error: function() {
            $('#recentpostbreaking').html('<strong>Error Loading Feed!</strong>');
       }
});
});
//]]>
</script>
  </b:if></b:if>
4) Customize your setting.Find any word click F3 orCtrl+F.
Replace YOUR URL HERE with your site url past here.
5) Now Find the code shown below using [ctrl+F] (Use In HTML Box)
</head>
6) Now Paste the Code Shown Below just Before it.
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<style type='text/css'>
#beakingnews{width:980px;margin:0 auto;line-height:25px;height:25px;background:#F7F7F7;overflow:hidden;margin-top:5px;}
#beakingnews .tulisbreaking{display:block;float:left;padding:0 7px;margin:0 5px 0 0;color:#FCFCFC;background:#5F0000}
#recentpostbreaking{float:left}
#recentpostbreaking ul,#recentpostbreaking li{list-style:none;margin:0;padding:0}
</style>
  </b:if></b:if>
7) Now save your template.
Step 2 : Add Widget to your blog
1) Go to Blogger Dashboard → Layout → Page Elements.
2) Add a HTML/JavaScript Gadget.
3) Paste below code in it.  
 
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>

<div id='beakingnews'><span class='tulisbreaking'>Breaking News</span><!-- tag pembuka tempat Breaking News-->
<div id='recentpostbreaking'>Loading...</div><!-- tag tempat daftar Breaking News ditampilkan-->
</div><!-- tag penutup tempat Breaking News-->
  </b:if></b:if>
<div style='clear: both;'/>
5) Save your Widget.Don't forget to add the widget on the Center place. 

Comments

Popular posts from this blog

Most-watched soccer games on US TV for April 3-8, 2018

Saturday’s Manchester Derby set a record for Premier League viewership in the United States with a total of 1.659 million people tuning their television to the match broadcast on NBC and Telemundo combined. NBC delivered 1.35 million viewers, its highest viewership for a Premier League match since Liverpool took on Man City on New Year’s Eve 2016. Telemundo delivered an additional 309,000 viewers for its Spanish-language broadcast. This ranks as just the fifth largest audience for Telemundo this season with December 10’s Manchester Derby drawing 495,000 viewers to the network. The United States Women’s National Team 6-2 defeat of Mexico averaged 627,000 viewers on the FOX network Sunday afternoon, making it FOX’s most-viewed match of 2018 thus far. Viewership was down 13.87% however from their previous appearance on the FOX network back in March 2017 when they faced England before an audience 728,000. Zlatan’s second MLS appearance delivered FOX Sports 1 ...

Yakubu Dogara congratulates wife, Gimbiya, as she is a year older

Speaker of the house, Federal Republic of Nigeria, Rt. Hon. Yakubu Dogara, has congratulated his wife, Gimbiya, as she is a year older and the speaker has taken his time to shower some accolades on her. Dogara said"Happy birthday to Virtuous woman, the rock of my family and the love of my life. Thy sun shall no more go down; neither shall thy moon withdraw itself as you continue to flourish like a palm tree bearing fruits in season and out of season." The wife of Bukola Saraki, Toyin Saraki, also congratulated Dogara's wife on her twitter account. She (Toyin) said"Happy Birthday to my dear sister, Mrs. Gimbiya- blessed to know you, even more blessed by your friendship. May all your years be blessed. Happy Eld too! Amen!

Hamilton’s ‘hacker for hire’ to be sentenced for Yahoo data breach

Hamilton’s so-called “hacker for hire” will be sentenced Tuesday afternoon. Karim Baratov pleaded guilty to charges in connection with the massive Yahoo data breach in 2014 that compromised more than 500 million user accounts. The 23-year-old was arrested over a year ago at his home in Ancaster for computer hacking, economic espionage and other crimes, and was extradited to the U.S. where he faces a maximum sentence of over 20 years in prison. The Department of Justice has asked a San Francisco federal court judge to impose a nearly eight-year prison term, including three years of supervision after his release. They also want Baratov fined to cover “any and all of his assets.” Defence attorneys have requested a sentence of 45 months. Baratov will be sentenced at 1:30 p.m. ET in San Francisco.