Saturday, December 15

How To Add Related Post Gadget Below Your Blog Post?

How To Add Related Post Gadget Below Your Blog Post? Blogging Tips, SEO,
Adding a related post widget or gadget helps your readers to access easily the related pages or posts you’ve written and also enhances the page views of your site. There are several practices done to add this gadget just blow a post; however this will help and work perfect as compare to others. 

Follow the steps and attempts to achieve this:
  • Go to your blog dashboard and click on template and then Edit HTML option to open the HTML page of your blog.
  • Click on the tick mark to expand the widget template;
  • Now search for </head> tag with Ctrl + F and paste the below mentioned code above it:
<!--Related Posts Scripts and Styles Start-->
<!--Remove--><b:if cond='data:blog.pageType == &quot;item&quot;'>
<style type='text/css'>
#related-posts {
float:center;
text-transform:none;
height:100%;
min-height:100%;
padding-top:5px;
padding-left:5px;
margin-top: 20px;
}
#related-posts .widget{
padding-left:6px;
margin-bottom:10px;
}
#related-posts .widget h2, #related-posts h2{
font-size: 17px;
font-weight: Bold;
color: black;
font-family: Georgia;
margin-bottom: 0.75em;
padding-top: 0em;
}
#related-posts a{
font-size:16px;
color: #1820E7;
font-variant:small-caps;
}
#related-posts a:hover{
text-decoration: none;
color: #ffffff;
font-weight: bold;
}
#related-posts ul{
list-style-type:none;
margin:0 0 0px 0;
padding:0px;
text-decoration:none;
text-color:#000000
}
#related-posts ul li{
list-style-type: none;
border-left: 2px solid #1399CF;
border-bottom: 1px dotted #1399CF;
margin-bottom: 3px;
padding-left: 30px;
padding-top:0px;
}

#related-posts ul li:hover{
background-color: #44BBB0;
border-left: 2px solid #B3CA3D;
border-bottom: 1px dotted #B3CA3D;
}
</style>
<script type='text/javascript'>
var relatedpoststitle=&quot;Related Posts&quot;;
</script>
<script src='http://helplogger.googlecode.com/svn/trunk/related_posts.js' type='text/javascript'/>
<!--Remove--></b:if>
<!--Related Posts Scripts and Styles End-->

 
# Change the font size and width and color code as per your choosy.
  • Now find the code:  <div class='post-footer'> and paste the below mentioned code just above it.

<!-- Related Posts Code Start-->
<!--Remove-->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='related-posts'> <b:loop values='data:post.labels' var='label'> <b:if cond='data:label.isLast != &quot;true&quot;'> </b:if> <b:if cond='data:blog.pageType == &quot;item&quot;'> <script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels&amp;max-results=6&quot;' type='text/javascript'/></b:if></b:loop>
<script type='text/javascript'> var maxresults=5; removeRelatedDuplicates(); printRelatedLabels(&quot;<data:post.url/>&quot;); </script> </div> <!--Remove--></b:if> <!-- Related Posts Code End-->

 
# Change the value of mazresults=5; to display the no. of posts to be shown in the gadget.
  • Now save the HTML template and see by clicking a post; is it doing or not?

No comments:

Post a Comment

Thanks for visiting my site

Naresh Behera


ABOUT ME

Copyright © 2012-13 || NareshBehera || All Rights Reserved || Maintained by: Basudha Computer