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!

14 Superfoods That Keep Your Body and Mind Strong

Superfoods are nutrient-rich and a catalyst for good health and overall well-being. Not only do they optimize your immune system (fewer missed workdays), but they also have body-healing compounds, reduce inflammation (bad disease instigator), and can kill off harmful bacteria. Added bonus: People who regularly consume super foods are healthier and thinner. What could be better than that? Obviously, your success and happiness depends on being in the best health possible, both mind and body. The great news is making these super foods a part of your routine can help you do just that. Here are 14 superfoods that just may help you live a more productive, longer, and healthier life. 1. Avocados This monounsaturated fat fruit contributes to an increased healthy blood flow and brain health. Avocados can lower blood pressure, decreasing the chance of cognitive decline. 2. Beans Beans are a great source of iron and fiber and can keep your cho...