Sunday, November 27, 2011

Make Related Post under Your Post

Hello Blogger Tuturials Friend... Now I'll tell you about how to make a related post under your post. it aims to allow visitors to see the articles on your blog are interlinked so that they can find things that maybe they are looking so they will comfortable in your blog and of course will increas traffic visitor in your blog.

Well... Follow the instructions below:


First, login to your blogger account > templates > edit HTML. then search this code </head> , copy and paste the following code under </head> kode.
<script type="text/javascript">
//<![CDATA[
var relatedTitles=new Array();var relatedTitlesNum=0;var relatedUrls=new Array();function related_results_labels(c){for(var b=0;b<c.feed.entry.length;b++){var d=c.feed.entry[b];relatedTitles[relatedTitlesNum]=d.title.$t;for(var a=0;a<d.link.length;a++){if(d.link[a].rel=="alternate"){relatedUrls[relatedTitlesNum]=d.link[a].href;relatedTitlesNum++;break}}}}function removeRelatedDuplicates(){var b=new Array(0);var c=new Array(0);for(var a=0;a<relatedUrls.length;a++){if(!contains(b,relatedUrls[a])){b.length+=1;b[b.length-1]=relatedUrls[a];c.length+=1;c[c.length-1]=relatedTitles[a]}}relatedTitles=c;relatedUrls=b}function contains(b,d){for(var c=0;c<b.length;c++){if(b[c]==d){return true}}return false}function printRelatedLabels(){var b=Math.floor((relatedTitles.length-1)*Math.random());var a=0;document.write("<ul>");while(a<relatedTitles.length&&a<20){document.write('<li><a href="'+relatedUrls[b]+'">'+relatedTitles[b]+"</a></li>");if(b<relatedTitles.length-1){b++}else{b=0}a++}document.write("</ul>")};
//]]>
</script>

The next step is paste the code below the above code ]]></b:skin>
/* RELATED-POSTS */
#rel-posts {font : 11px Verdana;border: 1px solid #ccc; margin-top: 20px;}
#rel-posts .widget h2, #rel-posts h2 {color : #940f04;background: #f4f4f4;font-size : 20px;font-weight : normal;margin : 0 ;padding : 5px ;border-bottom:1px solid #ccc;border-top:0;}
#rel-posts a {color : #054474;font-size : 11px;text-decoration : none;}
#rel-posts a:hover {color : #054474;text-decoration : none;}
#rel-posts ul {margin : 0;padding : 0;padding-left: 5px;}
#rel-posts ul li {line-height : 2em;border-bottom:1px dotted #cccccc;display: block;}
#rel-posts ul li:last-child{ border-bottom:none}

And the for last step,  paste the following code under this code <data:post.body/>

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='rel-posts'>
<h2>Related Post</h2>
<b:loop values='data:post.labels' var='label'>
<script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels&amp;max-results=5&quot;' type='text/javascript'/></b:loop>
<script type='text/javascript'> removeRelatedDuplicates(); printRelatedLabels();</script>
</div>
</b:if>

NB: the red word can be changed up to you.


Oke, thanks for  read my post about Make Related Post under Your Post. Don't forget to come back to this blog. Blogger Tutorial's blog.

Related Posts:

  • What is SEO ?Hy guys.. What is SEO ? it is a question that often appear on Blogger Newbies mind, but it does not apply to professional bloggers, because SEO is the main menu should they know to get success in the internet world. so for th… Read More
  • Introduction to SEOHello Bloger Tutorial Friends... I am sure that you already know about SEO. This article does not have to actually posted, but I think that maybe there are those among you who do not know, for that I post the article on Intro… Read More
  • Make Recent Post Widget on BlogHi Blogger Tutorials friend.. Now, I will give you a tips to Make Recent Post Widget on Blog. This will allow visitors to find the last article that you published. This is an effective way to make visitors stay on our blog an… Read More
  • Promoto Your Blog Using FeedHello Blogger Tutorials Friend.. One of the ways to promote your website is to provide fresh content on a regular basis and announce it by using feeds. Feed isa very useful way to distribute new content to your visitors andat… Read More
  • White Hat Vs Black Hat SEOHello Blogger Tutorials Friends.. Do you know about White Hat and Black Hat SEO??As online marketing becomes more popular, more companies turning to SEO unethical methods to get higher ranking and traffic. 'Black Hat SEO' is … Read More

0 comments:

Post a Comment