Untuk membuat related posts atau artikel terkait dibawah posting blogspot caranya adalah sebagai berikut:
1. Login ke Blogspot –> Rancangan –> Edit HTML. Beri centang atau tanda ceklis pada kolom Expand Template Widget.
2. Cari baris kode seperti berikut:
]]></b:skin>
</head>
</head>
<body>
<div id='outer-wrapper'><div id='wrap2'>
<div id='outer-wrapper'><div id='wrap2'>
lalu letakan baris kode yang berwarna merah berikut diatas baris kode </head> sehingga baris kodenya menjadi seperti berikut:
]]></b:skin>
<!---RELATED POST-->
<style> #related-posts { float : left; width : 540px; margin-top:20px; margin-left : 5px; margin-bottom:20px; font : 11px Verdana; margin-bottom:10px; } #related-posts .widget { list-style-type : none; margin : 5px 0 5px 0; padding : 0; } #related-posts .widget h2, #related-posts h2 { font-size : 20px; font-weight : normal; margin : 5px 7px 0; padding : 0 0 5px; } #related-posts a { text-decoration : none; } #related-posts a:hover { text-decoration : none; } #related-posts ul { border : medium none; margin : 10px; padding : 0; } #related-posts ul li { display : block; background : url("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz508ATsZ3kDz1H0HeC3IiWv2W6nLyzLADdkwvQIwjJN-crlcfWmly5kNlyuiGjfuz0JDlZMKeg3Zo5RqZmjakwtPE2KDeshPy86xxqpFYGyDA4cvB5C6-XNIw1V2i6S9uVu8AiQv85yI/") no-repeat 0 0; margin : 0; padding-top : 0; padding-right : 0; padding-bottom : 1px; padding-left : 21px; margin-bottom : 5px; line-height : 2em; border-bottom:1px dotted #cccccc; } </style> <script src='http://theblogtemplates.com/scripts/Related_posts_hack.js' type='text/javascript'/>
<!--END OF RELATED POST—>
<style> #related-posts { float : left; width : 540px; margin-top:20px; margin-left : 5px; margin-bottom:20px; font : 11px Verdana; margin-bottom:10px; } #related-posts .widget { list-style-type : none; margin : 5px 0 5px 0; padding : 0; } #related-posts .widget h2, #related-posts h2 { font-size : 20px; font-weight : normal; margin : 5px 7px 0; padding : 0 0 5px; } #related-posts a { text-decoration : none; } #related-posts a:hover { text-decoration : none; } #related-posts ul { border : medium none; margin : 10px; padding : 0; } #related-posts ul li { display : block; background : url("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz508ATsZ3kDz1H0HeC3IiWv2W6nLyzLADdkwvQIwjJN-crlcfWmly5kNlyuiGjfuz0JDlZMKeg3Zo5RqZmjakwtPE2KDeshPy86xxqpFYGyDA4cvB5C6-XNIw1V2i6S9uVu8AiQv85yI/") no-repeat 0 0; margin : 0; padding-top : 0; padding-right : 0; padding-bottom : 1px; padding-left : 21px; margin-bottom : 5px; line-height : 2em; border-bottom:1px dotted #cccccc; } </style> <script src='http://theblogtemplates.com/scripts/Related_posts_hack.js' type='text/javascript'/>
<!--END OF RELATED POST—>
</head>
<body>
<div id='outer-wrapper'><div id='wrap2'>
<div id='outer-wrapper'><div id='wrap2'>
Dimana: width:540px merupakan lebar related posts yang dibuat, rubah nilainya sesuai dengan lebar kolom posting.
3. Setelah itu cari baris kode berikut:
<data:post.body/>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>
dan letakan baris kode berwarna merah berikut dibawah baris kode <data:post.body/> sehingga baris kodenya menjadi seperti dibawah ini:
<data:post.body/>
<!--RELATED POST-->
<b:if cond='data:blog.pageType == "item"'>
<div id='related-posts'>
<font face='Arial' size='3'><b>Related Posts : </b></font><font color='#FFFFFF'><b:loop values='data:post.labels' var='label'><data:label.name/><b:if cond='data:label.isLast != "true"'>,</b:if><b:if cond='data:blog.pageType == "item"'>
<script expr:src='"/feeds/posts/default/-/" + data:label.name + "?alt=json-in-script&callback=related_results_labels&max-results=10"' type='text/javascript'/></b:if></b:loop> </font>
<script type='text/javascript'> removeRelatedDuplicates(); printRelatedLabels();
</script>
</div></b:if>
<!--END OF RELATED POST—>
<b:if cond='data:blog.pageType == "item"'>
<div id='related-posts'>
<font face='Arial' size='3'><b>Related Posts : </b></font><font color='#FFFFFF'><b:loop values='data:post.labels' var='label'><data:label.name/><b:if cond='data:label.isLast != "true"'>,</b:if><b:if cond='data:blog.pageType == "item"'>
<script expr:src='"/feeds/posts/default/-/" + data:label.name + "?alt=json-in-script&callback=related_results_labels&max-results=10"' type='text/javascript'/></b:if></b:loop> </font>
<script type='text/javascript'> removeRelatedDuplicates(); printRelatedLabels();
</script>
</div></b:if>
<!--END OF RELATED POST—>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>
</div>
dimana: max-results=10 adalah jumlah related posts yang ditampilkan, rubah sesuai keinginan.525
4. Simpan template dan lihat hasilnya.
referensi: www.ceritadarwinarya.com/2011/04/tips-related-post-pada-blogger.html
Recent Posts :
0 comments:
Post a Comment