If your blog is on Blogger.com/Blogspot.com, then you must know that there are no plugins like WordPress to add any Designs, Widgets, Functions etc.
To the website on Blogger, whatever we have to do It has to be done manually, due to which it takes more time and if you are writing an article and want to add related post in that article,
Then you will have to search related post from that article and then copy its title and link. Will have to add one by one.
So friends, today I have brought the solution of this problem in this post, I will tell you in this post How to Add Automatic Related Post in the Middle of an article on Blogger. So let's know.
Friends, if you add Automatic Related Post in the middle of the article, then it has many benefits, which are as follows -
(1) There is no need to add related links again and again in any article/post.
(2) Your time will be less in writing the post.
(3) It will show in all your New and Old posts.
(4) Gives a Professional Look to your post.
(5) Your visitors know on which topics you have written the post.
(6) There are chances of getting clicked on Related Posts as well.
(7) Clicking on Related Post will not increase the Bounce Rate of your site.
How To Add Automatic Releated Post In Middle Of An Article Of Blogger
<b:if cond='data:blog.pageType == "item"'> <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> </b:if>
/*RelatedPost - Tech Gyan*/ .post-terkait{display:block;position:relative;background:#fff;padding:0;margin:15px auto 20px;width:100%}.post-terkait h4{background:linear-gradient(44deg, #f00c1f, #f3eb00, #ffffff);padding:5px 9px;font-size:13px;text-transform:uppercase;color:#fff;border-top-left-radius:21px;line-height:normal;border:0}.post-terkait h4:before{display:none}.post-terkait ul{margin:0;padding:0}.post-terkait ul li{list-style:none;padding:1px 0;line-height:1.5em}.post-terkait a{color:#07ACEC;font-size:17px}.post-terkait a:hover{color:#ff0000;text-decoration:underline}
</b:if> <h4>Also Read</h4> <script type='text/javascript'> removeRelatedDuplicates(); printRelatedLabels(); </script> </div> <div expr:id='"post2" + data:post.id' class='artbody' itemprop='articleBody description'><data:post.body/></div> <script type='text/javascript'> var obj0=document.getElementById("post1<data:post.id/>"); var obj1=document.getElementById("post2<data:post.id/>"); var s=obj1.innerHTML; var t=s.substr(0,s.length/3); var r=t.lastIndexOf("<br>"); if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+4);} </script>