How to Install Multi Related Post in Posts

How to Install Multi Related Post in Posts
Have you ever seen links related posts that are inserted between the contents of the article on large sites? In Blogger, we can add it by adding the link in the post manually, but it will be a bit troublesome if every time we make a post because it is used to adding it.



Tips on Bloggers this time Sayem Tutorial will share How to Install Multi Related Posts in Posts .

Multi Related Post in this Post how it works is almost the same as the tips that I have shared before, precisely in the post How to Install Related Articles in the Post . That will display the article links related to the contents of the post randomly in each paragraph.

For example like the picture below:
Without Multi Related Post
The picture above is an example of the contents of the article before using the Multi Related Post and below is an example of a Multi Related Post link placement that will appear automatically in each paragraph of the post content:
With Multi Related Post
That's the picture. For those of you who are interested in trying it, please follow the steps below.

How to Install Multi Related Post in Posts

Open the Blogger page > Click the Themes menu and click the Edit HTML button > Add this CSS code before </head> .
<b:if cond='data:blog.pageType != &quot;index&quot;'>
<style type='text/css'>
/* Multi Related Post */
.arldzgnMultiRelated{background-color:#2a2a2a;color:#fff;margin:15px auto;display:-moz-box;display:-ms-flexbox;display:flex;flex-wrap:nowrap;justify-content:space-between;overflow:hidden;transition:all .3s}
.arldzgnMultiRelated:hover{background-color:#222}
.arldzgnMultiRelated .content{padding:12px 15px}
.arldzgnMultiRelated .content .text{margin-right:5px}
.arldzgnMultiRelated .content a{color:#fff;text-decoration:none;line-height:1.5em}
.arldzgnMultiRelated .content a:hover{text-decoration:underline}
.arldzgnMultiRelated .icon{height:auto;min-width:55px;background:#f44336 url(&quot;data:image/svg+xml,%3Csvg viewBox=&#39;0 0 24 24&#39; xmlns=&#39;http://www.w3.org/2000/svg&#39;%3E%3Cpath d=&#39;M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z&#39; fill=&#39;%23fff&#39;/%3E%3C/svg%3E&quot;) center / 40px no-repeat;transition:all .3s}
</style>
</b:if>
Next look for the code <data:post.body/>(if there are some <data: post.body /> codes select inside the conditional tag of the post page) and add the code below right below it. Also read: Latest Blogger Conditional Tags
function contains(yelfx, yufx) {for (var grefx = 0; grefx < yelfx['length']; grefx++) {if (yelfx[grefx] == yufx) {return true}};return false}
//]]>
</script>
<b:if cond='data:post.labels'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:view.isPost'>
<script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels&amp;max-results=100&quot;'/>
</b:if>
</b:loop>
</b:if>
<script type='text/javascript'>
//<![CDATA[
(function arldzgnMultiRelated() {var text = 'Also read :';let r = Math['floor']((relatedTitles['length'] - 1) * Math['random']());let i = 0;let jumlah = document['querySelectorAll']('.arldzgnMultiRelated');while (i < relatedTitles['length'] && i < jumlah['length']) {for (let a = 0; a < jumlah['length']; a++) {jumlah[a]['innerHTML'] = '<span class="content"><span class="text">' + text + '</span><a href="' + relatedUrls[r] + '" title="' + relatedTitles[r] + '">' + relatedTitles[r] + '</a></span><span class="icon"></span>';if (r < relatedTitles['length'] - 1) {r++} else {r = 0};i++}}})();
//]]>
</script>
</b:if>

After that click the Save theme button and finish. Click the Result button below to see the results.
Result
Full Post And Code Credit: Arlina Design ID

Post a Comment

Post a Comment (0)

Previous Post Next Post