For every bloggers the main problem in blogging is to make their visitors stay on their blog more and more. There are differnet methods that are widley used by bloggers to do so. Some of them are beautiful blog templates, easy navigations, low loading times, cross-browsers support, powerful and well structured articles and different widgets to give veiwers what they want at their finger tips.
Related posts widget is one of those techniques that are used by a large number of bloggers today to increase their visitors. Related posts are actually randomly selected posts with same tags and labels as the post is. Different related and random posts widgets are available in market with different visual styles. Use of these related post widgets can surely have a positive effect on one's blog.
The related posts widget shared below is a small size JavaScript widget with no links of any external files, therfore you don't have to worry about its loading time and 24 hour uptime. Features and Installation method with Codes are as follows:
Features
- Installation as easy as 123.
- CSS3 animations.
- Fully customizable.
- No Jquery only JavaScript.
- No Extrenal file linked.
Installation
- Go to Dashboard > Template.
- Click Edit HTML.
- Search for </head>.
- Copy paste the CSS code just before the </head>.
- Search for id='post' var='post'.
- Copy paste the HTML/JavaScript code just before </b:includable>.
- Save Template and you are done.
CSS Code
<style type='text/css'>#random-posts{
padding: 5px;
}
#random-posts li{
float: left;
list-style: none;
position: relative;
}
#random-posts li:last-child{
margin-right:0;
}
#random-posts li img{
width: 72px;
height: 72px;
padding: 6px;
}
#random-posts li img:hover{
background-color: #46a5b7;
}
#random-posts li .rp_animation{
position: absolute;
width: 250px;
top: -100px;
z-index: 2;
background-color: #fff;
padding: 5px;
border: 1px solid #ccc;
transition: all 0.6s cubic-bezier(1,2,0,0) 0s;
-moz-transition: all 0.6s cubic-bezier(1,2,0,0) 0s;
-webkit-transition: all 0.6s cubic-bezier(1,2,0,0) 0s;
-o-transition: all 0.6s cubic-bezier(1,2,0,0) 0s;
visibility: hidden;
opacity: 0;
}
#random-posts li:last-child .rp_animation{
right: 0;
}
#random-posts li:hover .rp_animation{
top: 61px;
opacity:1;
visibility: visible;
}
.rp_animation span{
color: #333;
}
.rp_animation p{
font-size: 14px;
}
</style>
HTML/JavaScript Code
<b:if cond='data:blog.pageType == "item"'><ul id='random-posts'>
<h2>Random Posts...!!!</h2>
<script type='text/javaScript'>
//<![CDATA[
var rdp_numposts = 7; //Number Of Random Posts
var rdp_snippet_length = 110; //Length Of Description Text, 0 To Hide
var rdp_datecomment = 'no'; //Show Date And Comment 'yes/no'
var rdp_comment = 'Comments'; //Text For Comment Count
var rdp_disable = 'Comments Are Off Here...'; //Text If Comment Is Disabled On Post/Blog
var rdp_current = [];
var rdp_total_posts = 0;
var rdp_current = new Array(rdp_numposts);
function totalposts(a){
rdp_total_posts=a.feed.openSearch$totalResults.$t
}
document.write('<script type="text/javascript" src="/feeds/posts/default?alt=json-in-script&max-results=0&callback=totalposts"></script>');
function getvalue(){
for(var b=0; b<rdp_numposts; b++){
var d=false;
var c=get_random();
for(var a=0; a<rdp_current.length; a++){
if(rdp_current[a]==c){
d=true;break
}
}
if(d){
b--
}
else{
rdp_current[b]=c
}
}
}
function get_random(){
var a=1+Math.round(Math.random()*(rdp_total_posts-1));
return a
};
//]]>
</script>
<script type='text/javaScript'>
//<![CDATA[
function random_posts(n){
a=location.href;
y=a.indexOf("?m=0");
for(var f=0; f<rdp_numposts; f++){
var l=n.feed.entry[f];
var m=l.title.$t;
if("content" in l){
var o=l.content.$t
}
else{
if("summary" in l){
var o=l.summary.$t
}
else{
var o=""
}
}
o=o.replace(/<[^>]*>/g,"");
if(o.length < rdp_snippet_length){
var k=o
}
else{
o=o.substring(0,rdp_snippet_length);
var b=o.lastIndexOf(" ");
k=o.substring(0,b)+" "}
for(var e=0; e<l.link.length; e++){
if("thr$total" in l){
var h=l.thr$total.$t+" "+rdp_comment
}
else{
h=rdp_disable
}
if(l.link[e].rel=="alternate"){
var d=l.link[e].href;
if(y!=-1){
d=d+"?m=0"
}
var g=l.published.$t;
if("media$thumbnail" in l){
var c=l.media$thumbnail.url
}
else{
c="http://1.bp.blogspot.com/_u4gySN2ZgqE/SosvnavWq0I/AAAAAAAAArk/yL95WlyTqr0
/s400/noimage.png"
}
}
}
document.write("<li>");
document.write('<a href="'+d+'" rel="nofollow"><img alt="'+m+'" src="'+c+'"/></a>');
document.write('<div class="rp_animation"><h4>'+m+"</h4>");
if(rdp_datecomment=="yes"){
document.write("<span>"+g.substring(8,10)+"/"+g.substring(5,7)+"/"+g.substring(0,4)+" - "+h+"</span>")
}
document.write("<p>"+k+"</p></div>");
document.write('<div style="clear:both"></div></li>')
}
}
getvalue();
for(var i=0; i<rdp_numposts; i++){
document.write('<script type="text/javascript" src="/feeds/posts/default?alt=json-in-script&start-index=' + rdp_current[i] + '&max-results=1&callback=random_posts"></script>')
};
//]]>
</script>
</ul>
<div style='clear:both'/>
</b:if>
If you have any quries feel free to ask.
Nice article...this post is outstanding in regards of both information as well as information.thanks for talking about you post with us.
ReplyDeleteNice articles and higlhy useful article
ReplyDeleteI am very happy when read this blog post because blog post written in good manner and write on good topic. Thanks for sharing valuable information.
ReplyDeleteTechnolgy, online reputation management ,Business Information Blog
This is really nice because it well informative for me and hope for others also keep it continued so that we can get benefits
ReplyDeletesubtitling services india, subtitling company in bangalore
Thank You for sharing and its interesting to know new things,Great.
ReplyDeleteERP System,Digital Marketing Agency
Hey Sir!
ReplyDeleteI hope you are doing Great, This is a very helpful Article for beginners, Thanks For Sharing This Information Keep up the Good Work.
Click Here to Get:- 10 Most Popular Recent Post Widget For Blogger
I was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. cbd oil tincture
ReplyDeleteThanks for taking the time to discuss this, I feel strongly that love and read more on this topic. If possible, such as gain knowledge, would you mind updating your blog with additional information? It is very useful for me. cbd vape juice
ReplyDeletePretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! order cbd oil
ReplyDeleteA very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. cbd deals justcbd
ReplyDeleteIm no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that. nature love quotes
ReplyDeleteVery nice article. Thanks for sharing such helpful blog post.
ReplyDeleteTranslation and Localization | Localization Companies in India | E-learning Localization
I want to put random posts from other blogspot not my own. Is it possible? How can I do that?
ReplyDeleteDigital commerce, also known as e-commerce , is indeed a business concept that allows businesses and individuals to buy and sell goods through the Internet. The growth of online developers in India has been fueled by advancements in the IT industry and increased consumer understanding of the Internet.
ReplyDeletePPC company in India
PPC Company in USA
Social Media Marketing Agency in Delhi
Adwords- PPC Management Company Delhi
Website Development company in ranchi
Grocery Unto 45% Off on Online Grocery Shopping-CapitalGrocery.in
ReplyDeleteSaffola Gold Pro Healthy Lifestyle Edible Oil (Pouch) (1 litre)
Saffola Gold Pro Healthy Lifestyle Edible Oil (Jar) (2 litre)
Saffola Active Pro Weight Watchers Edible Oil (Pouch) (1 litre)
Fortune Xpert Pro Sugar Conscious Edible Oil (Jar) (5 litre)
Fortune Xpert Pro Sugar Conscious Edible Oil (Pouch) (1 litre)
Very interesting blog. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know.
ReplyDeletewebsite speed test