VIEW:


BÀI LIÊN QUAN
Mình hôm nay tổng hợp và giới thiệu cho các bạn code để tạo hot new, breaking new, tin vắn, tin tức chạy tự động trong website/blogger chuẩn SEO. Tiện ích giúp cho các bạn có một website chuẩn SEO đưa tổng hợp những bài đăng cho người đọc hơn.

Bắt đầu thôi!!

Bước 1:

Các bạn vào blooger dưới quyền Admin, vào Mẫu, chỉnh sửa HTML

Bước 2:

Tìm tới thẻ đóng ]]></b:skin> chèn đoạn code phía dưới vào phía trên thẻ ]]></b:skin>
thangbme.com
/* Newsticker */
.tickeer,.tickeerHeaderBar{width:100%;padding:0;overflow:hidden}
.tickeer,.tickeertitle{font-family:times!important;font-weight:700}
.tickeerHeaderBar{height:30px;background:#f6f6f6;margin:0 0 5px;border-bottom:2px solid #f40}
.tickeer{color:#f40;margin:0;line-height:25px;text-align:left;font-size:16px;z-index:3;clear:both}
.tickeertitle{background:#f40;position:absolute;float:left;padding:0 10px;height:30px;line-height:30px;color:#FFF;text-transform:uppercase;font-size:12px;margin-right:10px;z-index:1}
@media screen and (max-width:800px){.tickeerHeaderBar{max-width:100% !important;width:100% !important;float:left !important}}

Bước 3:

Tìm tới đoạn mã sau:
<div class='clear'/><div id='main-area'><div id='main2'>

Copy và Paste đoạn code sau vào phía trên đoạn mã vừa tìm được:
thangbme.com
<!--newhot-->
<div class='tickeerHeaderBar'>
<div class='tickeer'><div class='tickeertitle'><i class='fa fa-refresh fa-spin fa-1x'/>&#160;&#160;Hot News</div>
<script type='text/javascript'>
var nMaxPosts=40;var nWidth=100;var nScrollDelay=115;var sDirection=&quot;left&quot;;var sOpenLinkLocation;var sBulletChar=&quot;&#9830;&quot;;</script>
<script src='/feeds/posts/default?alt=json-in-script&amp;callback=RecentPostsScrollerv2&amp;max-results=30 ' type='text/javascript'/>
</div></div>

Bước 4: 

Tìm tới thẻ </head> thêm đoạn code sau vào phía trên thẻ </head> vừa tìm được
thangbme.com
<script type='text/javascript'>
//<![CDATA[
function RecentPostsScrollerv2(json){var sHeadLines;var sPostURL;var objPost;var sMoqueeHTMLStart;var sMoqueeHTMLEnd;var sHeadlineTerminator;var sPostLinkLocation;try{sMoqueeHTMLStart="\<MARQUEE behavior=\"scroll\" onmouseover=\"this.stop();\" onmouseout=\"this.start();\" ";if(nWidth){sMoqueeHTMLStart=sMoqueeHTMLStart+" width = \""+nWidth+"%\"";}else{sMoqueeHTMLStart=sMoqueeHTMLStart+" width = \"100%\"";}
if(nScrollDelay){sMoqueeHTMLStart=sMoqueeHTMLStart+" scrolldelay = \""+nScrollDelay+"\"";}
if(sDirection){sMoqueeHTMLStart=sMoqueeHTMLStart+" direction = \""+sDirection+"\"\>";if(sDirection=="left"||sDirection=="right"){sHeadlineTerminator="&nbsp;&nbsp;";}else{sHeadlineTerminator="\<br/\>";}}
if(sOpenLinkLocation=="N"){sPostLinkLocation=" target= \"_blank\" ";}else{sPostLinkLocation=" ";}
sMoqueeHTMLEnd="\</MARQUEE\>"
sHeadLines="";for(var nFeedCounter=0;nFeedCounter<nMaxPosts;nFeedCounter++){var objPost=json.feed.entry[nFeedCounter];if(nFeedCounter==json.feed.entry.length)break;for(var nCounter=0;nCounter<objPost.link.length;nCounter++){if(objPost.link[nCounter].rel=='alternate'){sPostURL=objPost.link[nCounter].href;break;}}
sHeadLines=sHeadLines+"\<b\>"+sBulletChar+"\</b\> \<a "+sPostLinkLocation+" href=\""+sPostURL+"\">"+objPost.title.$t+"\</a\>"+sHeadlineTerminator;}
document.write(sMoqueeHTMLStart+sHeadLines+sMoqueeHTMLEnd)}catch(exception){alert(exception);}}
//]]>
</script>

Chú ý: Nếu tiện ích không chạy có thể là do website của bạn chưa để tiện ích Jquery thêm ngay dòng code này vào phía dưới thẻ <head>
<script src='//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js' type='text/javascript'/>



0 nhận xét Blogger 0

Đăng nhận xét

 
ThangShare © 2016. All Rights Reserved. Design by: Thắng BME - Sitemap
Top