Showing posts with label Popular Post. Show all posts
Showing posts with label Popular Post. Show all posts

21 Feb 2013

Add a Popular Posts Gallery just above your Blogger posts

The most strong and popular web design trend over last couple of years is a sliding horizontal panels also known as Sliders or Carousels. It's a very effective method to increase the web site usability and engage the user. This widget shows the most popular 10 posts on your blog just above your Blogger posts. You can see the Demo on my blog.

Let's start adding it

Before adding it you should know that this widget is not fully compatible with all templates, so please make a backup before making any changes to your blogger template. Now, follow these steps:

1. If you are using the old Blogger interface: 
  • Go to Dashboard - Design - Edit HTML - (make a backup) Expand Widget Template 
If you are using the new Blogger interface: 
  • Go to Dashboard - Template - Edit HTML - Proceed - (make a backup) Expand Widget Template
2. Search (CTRL + F) for this piece of code:

]]></b:skin>

3. Just above/before it, add the following code:

CSS CODE


#gallery{position:relative;margin:0 35px 20px;width:590px;height:126px;background:#ffffff}
#gallery .belt{position:absolute;top:0;left:0;list-style-type:none}
#gallery .panel{float:left;margin:20px;width:84px;height:86px;background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCrHOFF_AjQo71ZiRr2Gz0EQm7Kz1Bskf90OXicrR_uACLTYstManjnsd_NPci42FRxxmBVMAsrw_DZiV9FyG2Vz7pTHiP8tDzvJZUMR8JZjjW6XKLIZdeFma-PdBaJsyOkYNCyxLSqtUb/s1600/bg-slider.png) bottom center no-repeat;overflow:hidden}
#gallery .panel img{float:left;border:1px solid #DDD;margin:5px;width:72px;height:72px;background:#FFF;padding:0px}
#gallery .panel img:hover{filter:alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity:0.5;opacity:0.5}

Note: you can adjust the size of gallery, changing the values in red (590 and 126).

4. Now search for the following piece of code:

</head>


5. Just above/before it, add this code:

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>
<script src='http://helplogger.googlecode.com/svn/trunk/auto-slider.js' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
stepcarousel.setup({
galleryid: "gallery",
beltclass: "belt",
panelclass: "panel",
autostep: {enable:true, moveby:1, pause:6000},
panelbehavior: {speed:500, wraparound:true, persist:true},
defaultbuttons: {enable: true, moveby: 2, leftnav: ["https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSLNbnkmW1Kf2n8UPR051w7O-i0LrEBLKnGUgag3CH3SjZE-5HfUY_e8RS7XMQON9pdLlo_Gw-6dyEbJf2mtgCDhS7tg2CycBBszTv16U3z4bBkVOFIEcB1XImabyJwb8NE13o2B0ohyphenhyphenzx/s1600/prev.png", -40, 36], rightnav: ["https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja2P4bw1XT4Ysd9f9qPWxUMlJfNTlhiOJBUtwh2YQbXYh6oUCO0GkHXT8tEkLwql6pbdKMv5sVOUmN3Ebx5FrMYkN-fdnNdkTw5pEZtNmtEsN5Y3mLvVVKVdkG61qkEhtbuDvIe7KfSqpb/s1600/next.png", 2, 36]},
contenttype: ["external"]
})
//]]>
</script>

Next thing to do is to place the widget just above the blogger posts.

6. Search for this code:

<b:section class='main' id='main' showaddelement='yes'>

...or if you can'find it, search for this one:

<b:section class='main' id='main' showaddelement='no'>

7. Just below it, add the following code:

<b:widget id='PopularPosts2' locked='false' title='Popular Posts' type='PopularPosts'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<div style='margin-top:20px;margin-bottom:70px;margin-left:-20px;'>
  <div id='gallery'>
   <ul class='belt'>
    <b:loop values='data:posts' var='post'>
     <li class='panel'>
      <b:if cond='data:showThumbnails == &quot;false&quot;'>
       <b:if cond='data:showSnippets == &quot;false&quot;'>
        <a expr:href='data:post.href' expr:title='data:post.title' rel='bookmark'><data:post.title/></a>
       <b:else/>
        <div class='item-title'>
         <a expr:href='data:post.href' expr:title='data:post.title' rel='bookmark'><data:post.title/></a>
        </div>
        <div class='item-snippet'>
         <data:post.snippet/>
        </div>
       </b:if>
      <b:else/>
       <a expr:href='data:post.href' expr:title='data:post.title' rel='bookmark'>
        <b:if cond='data:post.thumbnail'>
         <img expr:alt='data:post.title' expr:src='data:post.thumbnail'/>
        <b:else/>
         <img alt='no image' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje_sUHFz9Ul4Y-BQb_tj0KCmYAdTEqB514Dzyz0eGlTmO3Vs1lmMR91rUfbJ3nsfKBhjaXMwky7XoFt3bKo4bQ8zQi7blaDjyFmqmyp8PzDON3BH-7G8uCoTCeGrHYxlPFnlEBTm0cdSRB/s1600/no-image.PNG'/>
        </b:if>
       </a>
      </b:if>
     </li>
    </b:loop>
   </ul>
  </div></div></b:if>
 </b:includable>
</b:widget>

Note: delete the fragments of code in blue if you want this widget to be displayed in posts pages also.

8. Preview and if everything is ok, Save the Template.

Save this Image For Your Back UP:If Image Host down ,Upload this image in any image host Website And Then replace the link in Above Code 



22 Sept 2012

How to Add related posts widget with Thumbnail New!!! Latest 2012

Add Related Posts Widget with Thumbnail in Blogger 

Advantage of having related posts widget is that, Suppose any user is reading one of your blog post and seeking for some information. After finishing of reading he might be impressed with your post and want to visit another, then this widget is easiest way for surfing through related posts. Thus Number of page visits will be increased and as well your traffic bounce ratio will be decreased gradually.

Steps to Add Related Posts Widget with Thumbnail in Blogger
 
 
Note: Before making any changes to your template, take a full backupof your blogger template.

#Step 1. Log in to your Blogger Dashboard and Navigate to Layout > Edit HTML and checked the Expand Widget Templates Check box.

layout edit html expand widget template
#Step 2. Find(Ctrl+F) 
 </head> and 
replace it with this code:



<!--Related Posts with thumbnails Scripts and Styles Start-->
<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;
}
#related-posts h2{
font-size: 1.6em;
font-weight: bold;
color: black;
font-family: Georgia, &#8220;Times New Roman&#8221;, Times, serif;
margin-bottom: 0.75em;
margin-top: 0em;
padding-top: 0em;
}
#related-posts a{
color:black;
}
#related-posts a:hover{
color:black;
}
#related-posts a:hover {
background-color:#d4eaf2;
}
</style>
<script src='http://sites.google.com/site/besthowtoblogger/blogspot/relatedPostWiththumbs.js' type='text/javascript'/>
</b:if>
<!--Related Posts with thumbnails Scripts and Styles End-->
</head>
#Step 3. Find the either line given below.
<div class='post-footer-line post-footer-line-1'>
OR
<p class='post-footer-line post-footer-line-1'> 
Put the code given below immediately after the above one.
<!-- Related Posts with Thumbnails Code Start-->
<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_thumbs&amp;max-results=6&quot;' type='text/javascript'/></b:if></b:loop>
<script type='text/javascript'>
var currentposturl=&quot;<data:post.url/>&quot;;
var maxresults=5;
var relatedpoststitle="Related Posts";
removeRelatedDuplicates_thumbs();
printRelatedLabels_thumbs();
</script>
</div><div style='clear:both'/>
</b:if>
<!-- Related Posts with Thumbnails Code End-->


#Step 4. You can adjust the maximum number of related posts being displayed by editing this line in the code:
var maxresults=5;
To edit the title of the widget you can change this line of code: 
var relatedpoststitle="Related Posts"; 

#Step 5. Save template and done!.

Update: it is possible to make the thumbnail larger:
- Find ]]></b:skin> code in your blog and put below css code just before that.


#related-posts img { 
height:150px !important;
width:150px !important;
}
Done :)

13 Sept 2012

Customize Blogger's Official Popular Posts Widget

Popular posts widget





















  1.  Go To Blogger > Design
  2. Click on add a gadget and select the "Popular Posts" gadget from the list provided by blogger
  3. Now make these settings 
uncheck snippets and thumbnails
  • Set Most viewed to all time
  • Uncheck image Thumbnail and snippet. We only need to display popular links so we don't need that bulky image and unnecessary intro text.
  • You can display between 1 to 10 posts. So choose at least 7 posts.
       4.   Save your widget
       5.    Now go to Blogger > Design > Edit HTML
       6.   Backup your template
       7.   Search for this

]]></b:skin>
8.    Just above it paste the following CSS code,


/*--- MBT Popular Posts --- */
.popular-posts ul{padding-left:0px;}
.popular-posts ul li {background: #FFF url(http://1.bp.blogspot.com/_7wsQzULWIwo/ SmodosCuJCI/AAAAAAAABh4/ZSXbVW9Qpa8/s400/261.gif) no-repeat scroll 5px 10px;
list-style-type: none;
margin:0 0 5px 0px;
padding:5px 5px 5px 20px !important;
border: 1px solid #dddddd;
border-radius:10px;
-moz-border-radius:10px;
-webkit-border-radius:10px;
}
.popular-posts ul li:hover {
border:1px solid #6BB5FF;
}
.popular-posts ul li a:hover {
text-decoration:none;
}

Make these changes to customize the default look:
  • To change the bullet image replace the image link in bolded black in the code above with your bullet URL.
  • To change the border color in active mode edit #dddddd
  • To change the border color on mouse hover edit  #6BB5FF
You can use our color Chart for changing the colors.
   9.    Finally save your widget and say bingo!
Visit your blogs to see it hanging just fine on your sidebar. Do let me know if you needed any further help in changing the font type or color. The widget will automatically apply to it default colors of your blog but in case you wish to change them to something different then feel free to let me know by posting your comments below.

Related Posts Plugin for WordPress, Blogger...

Subscribe Updates, Its FREE!