Today we will create a dynamic and automated recent posts slider for blogger using Blogger JSON Feed and jQuery. We will display recent posts of your blog inside FlexSlider which is a free slider plugin provided by woothemes. The slider gives a feeling of a tab widget where you can switch from one slide to another using the tab buttons or navigational controls. WordPress users have already integrated recent posts inside flexslider but this is the first time blogspot users will be able to display automatic list of recent posts inside a image slider.
Today's recent posts slider is coded using the same logic with which we coded our last JSON widget except for few design differences.
How to enable or disable the flex slider?
The logic is extremely simple. If you want to display and enable FlexSlider then insert even integer value next to ListCount, such as 2,4,6,8,10,12 etc. The JavaScript logic above will divide your inserted value into two sections and will display posts in each slide accordingly.
Output will be such:
For displaying a dynamic Flat list or in other words to disable FlexSlider insertodd integer value next to, such as 1,3,5,7,9,11 etc.
Output will be such:
Wasn't that easy? =)
DEMO
Unique Features of Automated Recent Posts Slider
Today's recent posts widget has some unique features introduced first time online:- Author Avatar - Unique!
- Displays recent posts insideDynamic Slider or as a Dynamic Flat list. - Unique!
- Displays recent posts from a specific category/label.
- Slider with two animations: Slide & Fade
- Clickable Comments Count
- Custom Date Format in ribbon fashion - Unique!
- Clickable Animated Featured Thumbnails - Unique!
- Option to increase or decrease thumbnail Resolution - Unique!
- Support for Third-party Images andYouTube thumbnails - Unique!
- Title Length is adjustable
Add Automatic Recent Posts Slider Widget in Blogger
Follow these easy steps to add recent posts slider to your blogspot blog:- Go To Blogger > Template
- Backup your template
- Click "Edit HTML"
- Just below
<head>
tag paste the following JS and CSS source links: Note: Do not add JQuery, FontAwesome or Oswald links in the code above to your template if you are already using them on your site. - Next search
]]></b:skin>
and just above it paste the following code: Make these changes- To change the green color theme of the slider simply replace the green highlighted color codes with color of your choice. The color can be in rgb or #hexadecimal, both work. Use our Color Code Generator.
- Save your template.
- Now go to Blogger > Layout
- Select "Add a Gadget"
- Choose "HTML/JavaScript" gadget
- Keep the title field empty and then paste the following code inside it:
- animation: Select your animation type, "fade" or "slide"
- slideshowSpeed: You can set the speed of the slideshow cycling, in milliseconds
- animationSpeed: You can also set the speed of animations, in milliseconds
- pauseOnHover: Pause the slideshow when hovering over slider, then resume when no longer hovering
- You can edit the widget title by editing: Recent Posts Slider
- If you don't want to use the title then delete the yellowhighlighted code.
- ListBlogLink : Insert your Blog link here
- ListCount : Decide how many posts do you wish to display. Choose even integer only like 2,4,6,8,10 etc.
- ListLabel : Insert your blog label/category here. Remember that labels are case sensitive. Therefore type it exactly as it is shown in your browser address bar. If your label is "blogging tips" and if you type it as "Blogging Tips" then it wont work. You must make sure that all letters are written in correct cases.
- TitleCount : Choose how many characters to display in post title.
- ImageSize : You can control the resolution or aspect ratio of thumbnails by editing ImageSize = 150; where the value 150means that you want your images to be within 150 x 150 pixels in size. Keep this value close to the thumbnail size to ensure website load time is not effected a lot. Since our thumbnail images have a width of about 110px,therefore I have kept the resolution as 150, slightly higher to display images in slightly good quality.
- If you want to show recent posts published on your blog but don't wish to display posts from a specific label then simply remove /-/"+ListLabel+"from the code above.
The following control options will help you modify the widget: - Click Save and you are all done!
Display Slider or Just a Flat List!
Fortunately I have setup the logic such that you can choose whether to display your posts inside animated FlexSlider or display them as simple flat list similar to my earlier recent posts widget. In other words you can choose to enable or disable the FlexSlider.How to enable or disable the flex slider?
The logic is extremely simple. If you want to display and enable FlexSlider then insert even integer value next to ListCount, such as 2,4,6,8,10,12 etc. The JavaScript logic above will divide your inserted value into two sections and will display posts in each slide accordingly.
Output will be such:
For displaying a dynamic Flat list or in other words to disable FlexSlider insertodd integer value next to, such as 1,3,5,7,9,11 etc.
Output will be such:
Wasn't that easy? =)
Let me know if you have any questions or if you need any assistance. I hope this new widget will take your blogspot blog to the next level and help you spice up your blog with one more unique widget which was formerly found only on wordpress blogs. Why Should Wordpress folks have all the fun! =)
0 Comments