The blogger would like to read the post a lot. Most people only visit the blog page only, while other articles untouched because of the difficulty of accessing other article. Therefore, the Related Posts feature is very useful to improve the Page View of our Blog.
What Functions Related to Articles (Related Posts)? The functions of related posts or articles related to SEO's (search engine Optimization) blog other than to make us look good, relevant article (related post) really helped traffic / visitors to more freely read other articles that might be useful to know. This is certainly very easy for both visitors and blogger.
In addition, an interesting title will lure the reader to click on the article. So, keep posting attractive title so that when the reader/visitor/blogger has finished reading an article, she/he will be curious and visit the other articles.
How to make related post in blogger? Do the steps bellow :
1. Login to Blogger
1. Login to Blogger
2. Go to Dashboard Blogger, select your blog, click on the template,
3. Click edit HTML
4. Then, find this code </head> (use ctrl + F on Your Keyboard)
5. The next step, place the following code just above the code </head>
<script type="text/javascript">
//<![CDATA[
var relatedTitles = new Array();
var relatedTitlesNum = 0;
var relatedUrls = new Array();
function related_results_labels(json) { for (var i = 0; i < json.feed.entry.length; i++) {
var entry = json.feed.entry[i];
relatedTitles[relatedTitlesNum] = entry.title.$t; for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
relatedUrls[relatedTitlesNum] = entry.link[k].href; relatedTitlesNum++; break;}}}}
function removeRelatedDuplicates() {
var tmp = new Array(0);
var tmp2 = new Array(0); for(var i = 0; i < relatedUrls.length; i++) {
if(!contains(tmp, relatedUrls[i])) {
tmp.length += 1; tmp[tmp.length - 1] = relatedUrls[i]; tmp2.length += 1; tmp2[tmp2.length - 1] = relatedTitles[i];}} relatedTitles = tmp2; relatedUrls = tmp;}
function contains(a, e) { for(var j = 0; j < a.length; j++) if (a[j]==e) return true; return false;}
function printRelatedLabels() {
var r = Math.floor((relatedTitles.length - 1) * Math.random()); var i = 0; document.write('<ul>'); while (i < relatedTitles.length && i < 20) {
document.write('<li><a href="' + relatedUrls[r] + '">' + relatedTitles[r] + '</a></li>'); if (r < relatedTitles.length - 1) { r++; }
else { r = 0;} i++;} document.write('</ul>');}
//]]>
</script>
6. Search code <data:post.body/> (use ctrl + F on Your Keyboard) then place it under the following script code <<data:post.body/>
<b:if cond='data:post.labels'>
<b:loop values='data:post.labels' var='label'>
<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=15"' type='text/javascript'/> </b:if>
</b:loop>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<h4>Artikel Terkait <b:loop values='data:post.labels' var='label'><data:label.name/>
<b:if cond='data:label.isLast != "true"'>,</b:if></b:loop></h4>
<script type="text/javascript"> removeRelatedDuplicates(); printRelatedLabels();
</script>
</b:if
7. Then click Save Template, done.
Please do “preview” to make sure the widget is running or not, after that, please save your template and then see the result .... interesting ??
Thus sharing to Make Related Post hopefully useful.
Please do “preview” to make sure the widget is running or not, after that, please save your template and then see the result .... interesting ??
Thus sharing to Make Related Post hopefully useful.
Do not be afraid to try something new. Each person must try and error experience.
0 comments:
Post a Comment