How To Make Auto and Manual Related Post Middle of Article in Median UI Template ?
How To Make Auto and Manual Related Post Middle of Article in Median UI Template ? - Code Store 360
Hello Everyone, on this occasion I will share a tutorial on How To Make Related Post Middle of Article in Median UI Template. This related post I set will appear in the fifth paragraph. You can change it according to you. The script I'll share this time uses pure JavaScript without jQuery, so it won't have any ill effects when you load this blog and it automatically appears in each post manually in the middle of the post. Is. Come on, you can also set how many related posts you want to appear in the paragraph.
What is Related Posts :-
The Related Post is a Reference or Recommendation to an article that is still related to the article being read by the current visitor. In the sense that the article is still with the same topic that the visitor reads. This will surely make the reader curious and prompt the reader to click on the related article after reading the current article. Of course this is great for our blog's traffic because the visitor doesn't leave immediately after reading the article they're looking for.
This Tutorial Median UI v1.5 Users Only :-
The post-body id changed to postBody because of the update to version 1.5, so the above code won't run, so I also created a special Median UI Template user as below.
The default template for version 1.5 already has css, so we just need to add javascript and json to display it automatically.
How To Make Manual Related Post in Middle of Article in Median UI Template :-
Step 1 :- Copy the below code and save this code where you want to show related post.
<!--[ Related title ]-->
<div class="postRelated">
<b>See Also :</b>
<ul>
<li><a href="Your_Url">Demo 1</a></li>
<li><a href="Your_Url">Demo 2</a></li>
<li><a href="Your_Url">Demo 3</a></li>
</ul>
Step 2 :- Then Don't Forget to Click on Save and See The Result.
How To Make Auto Related Post in Middle of Article in Median UI Template :-
Step 1 :- First Go To Blogger.Com And Login Your Blogger Account.
Step 2 :- Then Click on Theme Menu After Click on Edit Html.
<b:include cond='data:view.isPost and !data:view.isPreview' data='post' name='postTextRelated'/><script>/*<![CDATA[*/ function insertAfter(tbh,tgt) {var prt = tgt.parentNode; if (prt.lastChild == tgt) {prt.appendChild(tbh);} else {prt.insertBefore(tbh,tgt.nextSibling);}} var tgt = document.getElementById("postBody"); var midAd3 = document.getElementById("postRelated"); var showAd3 = tgt.getElementsByTagName("p"); if (showAd3.length > 0) {insertAfter(midAd3,showAd3[5]);}; /*]]>*/</script>
(midAd3,showAd3[5] which I marked number 5 means that the related post will appear after the 5th paragraph so please adjust it, keep in mind when writing the paragraph you must use the p tag if you use the br tag then the related post will not appear.
Join our Telegram Group and type #IV2.6PBTFD for Password.
Please backup your theme before upload new one
Student | Website Designer .... From Bangladesh 🇧🇩
2 comments
Darshan Gowda
11/28/2021 08:51:00 pm
Sir, how to add Author at end of the like you have added in this post.
Jubayer Ahmed
1/06/2022 11:02:00 pm
This is to sample. Just message us in our Telegram Group. We will help you.