1. Chèn đoạn code bên dưới vào trước thẻ đóng </head> :
<!--chen Box bai viet lien quan -->
<style>
#rp-pre {
float:right;
width:150px;
padding-left:10px;
}
#rp-content {
border:1px solid #bbb;
background:#eee;
}
#rp-title {
text-align: center;
background:#bbb;
font-weight:bold;
color:#F95107;
margin:3px;
padding-bottom:2px;
}
#rp-posts {
position:relative;
left:-20px;
}
#rp-posts a {
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0fHDnyW-NwHTfRwlEzIhhyphenhyphenlK1Fp-fKUg30RvtyaOpztE7w6MYe2CBqBV4pqDxnkJoIJoLa2JKBcgcGU28niPMW-EzUhQnnY62_FIg6vUI37vesNwuXzOCYV1INeP649k-Q8NIcVKtchs/s1600/icon-related-post-namkna-blogspot-com.gif) no-repeat left;
padding-left:13px;
}
#rp-posts ul li {
list-style :none;
}
</style>
<script>
//<![CDATA[
function getRandomPosts(json) {
var numPosts = json.feed.openSearch$totalResults.$t;
var indexPosts = new Array();
for (var i = 0; i < numPosts; ++i) {
indexPosts[i] = i;
}
indexPosts.sort(function() {return 0.5 - Math.random()});
if (maxEntries > numPosts) {
maxEntries = numPosts;
}
var container = document.getElementById('rp-posts');
var ul = document.createElement('ul');
for (i = 0; i < maxEntries; ++i) {
var entry = json.feed.entry[indexPosts[i]];
var li = document.createElement('li');
var a = document.createElement('a');
a.title = entry.title.$t;
for (var j = 0; j < entry.link.length; ++j) {
if (entry.link[j].rel == 'alternate') {
a.href = entry.link[j].href;
break;
}
}
a.appendChild(document.createTextNode(entry.title.$t));
li.appendChild(a);
ul.appendChild(li);
}
container.appendChild(ul);
}
//]]>
</script>
<script type='text/javascript'>
var maxEntries = 4;
</script>
<!-- ket thuc -->
2. Thêm đoạn code bên dưới vào trước dòng code
<data:post.body/>
:
<!--box bai viet lien quan -->
<b:if cond='data:blog.pageType == "item"'>
<div id='rp-pre'>
<div id='rp-content'><div id='rp-title'>Bài liên quan</div>
<div id='rp-posts'/>
<a href='http://www.vanlotsan.xyz'>
<img height='150/' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQTnnDlih_PzKll1dX_HBwmLrzknRtFWl_vaFod6NlrnWHNFHLpLGcMvyOxJFe46rkXGUB-kNngghlDSTm-qW1rc73U0yRNMr9fmPSIW7ajjD2x23dMHJfLbIHlc4zUQ3K-6_EvzWbXGg/s1600/Sangocaosu1.jpg' width='468'/>
</a>
<center><b><a href='http://www.vanlotsan.xyz'>
Sàn gỗ tự nhiên</a> - gỗ cao su - giá Chỉ 460.000đ/m2 - Liên hệ : 0968.970.650</b></center>
<a href='http://ntwood.vn/Thot-Go-385-1.html'>
<img height='150/' src='https://c1.staticflickr.com/8/7177/27141709624_0d0678aaf8_c.jpg' width='468'/>
</a>
<center><b>Sản xuất<a href='http://ntwood.vn/Thot-Go-385-1.html'>
Thớt gỗ </a>theo đơn đặt hàng - Liên hệ 0968.970.650
</b></center>
<a href='http://ntwood.vn/Nguyen-lieu-go-xe-theo-quy-cach-su-lua-chon-sang-suot-cua-cac-nha-san-xuat-398-4.html'>
<img height='150/' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrHDxFcSs5NcTxNb61TPsZQlITPM13q7fZ4CYjWg-KhJFN7T4BRl-iZQIcneFsaCX-B0jG1-bahbCB8Mg1HMDzx7lCTxkpqg1lsV0xbI4cxw34ifgNwQrUcz0i8yiWwIGZ52xFHA5wd3Q/s1600/Phoi+tuoi+go+cao+su+xe+van.png' width='468'/>
</a>
<center><b>Sản xuất<a href='http://ntwood.vn/Nguyen-lieu-go-xe-theo-quy-cach-su-lua-chon-sang-suot-cua-cac-nha-san-xuat-398-4.html'>
Gỗ xẻ theo quy cách </a> - Liên hệ 0968.970.650
</b></center>
<a href='http://ntwood.vn/Go-ghep-theo-quy-cach-su-lua-chon-thong-minh-cua-cac-cong-ty-san-xuat-go-399-4.html'>
<img height='150/' src='https://c1.staticflickr.com/8/7178/27362929080_01d477fe84_b.jpg' width='468'/>
</a>
<center><b>Sản xuất<a href='http://ntwood.vn/Go-ghep-theo-quy-cach-su-lua-chon-thong-minh-cua-cac-cong-ty-san-xuat-go-399-4.html'>
Gỗ ghép theo quy cách </a> - Liên hệ 0968.970.650
</b></center>
</div></div>
<b:loop values='data:post.labels' var='label'>
<script expr:src='"/feeds/posts/summary/-/" + data:label.name + "?alt=json-in-script&callback=getRandomPosts&max-results=999"' type='text/javascript'/>
</b:loop>
</b:if>
<!-- ket thuc -->
Box bài viết liên quan cạnh bên phải bài viết blogspot (sử dụng chèn quảng cáo )
22:07
0