Tuesday, July 3, 2012

How To Add Jquery Recent Post Slider For Blogger

This is cool trick. You can add recent post as your
slider. So, This will help you to show your recent post
with  slider effect.This is not hard to add it to your blog.
Im Providing Demo for this post. so you can figure out
how this trick working. click below demo link to see
demo.

Demo


1. Log in to blogger account and Go to Design >> Edit HTML
    (make sure backup your template first)

2. Find this tag by using Ctrl+F    ]]></b:skin>

3. Paste below code Before ]]></b:skin> tag

#slide-container {
    height: 300px;
    position: relative;
    width: 480px;
}
#slider {
    height: 360px;
    left: 25px;
    overflow-x: hidden;
    overflow-y: hidden;
    position: relative;
    width: 480px;
    font-family: calibri;}
.slide-desc {
    background: transparent url(http://i195.photobucket.com/albums/z105/dantearaujo/darkbg.png) repeat scroll 0 0;
    color: #FFFFFF;
    padding: 10px;
    position: absolute;
    right: 0px;
    text-align: left;
    top: 0;
    width: 200px;
    z-index: 99999;
}
.slide-desc h2 {
    display: block;
}
.crosscol .widget-content {
    position: relative;
}
#slider ul, #slider li,
#slider2 ul, #slider2 li {
    margin: 0;
    padding: 0;
    list-style: none;
}
#slider2 {
    margin-top: 1em;
}
#slider li, #slider2 li {

    width: 480px;
    height: 360px;
    overflow: hidden;
}
#prevBtn, #nextBtn,
#slider1next, #slider1prev {
    display: block;
    width: 30px;
    height: 77px;
    position: absolute;
    left: -30px;
    text-indent: -9999px;
    top: 71px;
    z-index: 1000;
}
#nextBtn, #slider1next {
    left: 520px !important;
}
#prevBtn, #nextBtn, #slider1next, #slider1prev {
    display: block;
    height: 77px;
    left: 0;
    position: absolute;
    top: 132px;
    width: 30px;
    z-index: 1000;
}
#prevBtn a, #nextBtn a,
#slider1next a, #slider1prev a {
    display: block;
    position: relative;
    width: 30px;
    height: 77px;
    background: url(http://i195.photobucket.com/albums/z105/dantearaujo/prev.png) no-repeat 0 0;
}
#nextBtn a, #slider1next a {
    background: url(http://i195.photobucket.com/albums/z105/dantearaujo/next.png) no-repeat 0 0;
}
/* numeric controls */
ol#controls {
    margin: 1em 0;
    padding: 0;
    height: 28px;}
ol#controls li {
    margin: 0 10px 0 0;
    padding: 0;
    float: left;
    list-style: none;
    height: 28px;
    line-height: 28px;}
ol#controls li a {
    float: left;
    height: 28px;
    line-height: 28px;
    border: 1px solid #ccc;
    background: #DAF3F8;
    color: #555;
    padding: 0 10px;
    text-decoration: none;}
ol#controls li.current a {
    background: #5DC9E1;
    color: #fff;}
ol#controls li a:focus, #prevBtn a:focus, #nextBtn a:focus {
    outline: none;}
/* By bloggertrix.com */

4. Now again Find this tag by using Ctrl+F    </body>

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js' type='text/javascript'></script>
<script src='http://accordion-template.googlecode.com/svn/trunk/easySlider1.7.js' type='text/javascript'></script>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function(){
 $("#slider").easySlider({
 auto: true,
 continuous: true
 });
});
//]]>
</script>
<!-- by bloggertrix.com -->

5. Click Save Template

6. Now Go to Design >> Page Element

7. Click Add Gadget and select 'HTML/Javascript'

8. Paste below code.

<div id="slider">
<script style="text/javascript" src="http://btrixx.googlecode.com/files/recentslider.js"></script>
<script style="text/javascript">
 var numposts_gal = 6;
 var numchars_gal = 150;
 var random_posts = false; // random posts
</script>
<!-- replace with your web address (marked with red color) -->
<script src="http://bloggertrix.com/feeds/posts/default?orderby=published&alt=json-in-script&callback=showgalleryposts&max-results=999999"></script>
</div>

* You can change numbers of showing post by Changing   6
* You can change numbers of post characters  by Changing  150

  Replace bloggertrix.com with your site/ URL

9. Now save HTML/Javascript'. You are done.

12 comments:

  1. I've been Googling for this but haven't found the one which really works...I tried it in my test blog and it's perfectly working...thanks my fried for sharing this wonderful trick.

    ReplyDelete
  2. thnks it really amazing .....thanx again but i have little problem in my blog www.bangaliphoto.blogspot.com at top show the code how remove it plz say...and You can change numbers of post characters by Changing 150 in the use of photo blog

    ReplyDelete
  3. @Milan Aryal
    thanks you.

    @Nazmul Haq
    you added code in wrong place, thats why its showing.yes.you can change post and characters by changing above code as i told.
    if you want to add this, you can send your template code via contact us, ill add it and send back to you.

    ReplyDelete
  4. Thanks for your post. It was very useful!

    Just one question: What do I have to add in the code if I want the slider only appears in the home?

    Thanks!

    ReplyDelete
    Replies
    1. check this below post

      http://www.bloggertrix.com/2012/06/how-to-show-blogger-gadget-widget-in.html

      Delete
  5. Hi! Sorry, but I cannot find any widget of the slider with code starting with and end with .

    Could you help me out, please? Thanks!

    ReplyDelete
    Replies
    1. Contact me, via Contact Us form. I will help you.

      Delete
  6. That was very helpful. Thanks a lot. Cheers

    ReplyDelete
  7. I can't understand why it didn't work on my blog, please can you help me?

    ReplyDelete
    Replies
    1. I sent a email to you. can you check it please...

      Delete
  8. it was really helpful this tutor was simple and easy to add thanks alot

    ReplyDelete