Blogger Team introduced their official Popular Post widget which could display a snippet of your most viewed posts along with a thumbnail image based on your Analytics stats. It has also three displaying modes: display title only, display title with image thumbnail or display title along with the posts snippets. But this default widget is not attractive, to make it attractive and looks your sidebar more beautiful we must customize and add a new variable and some CSS codes to your blogger template. You might have seen this widget in wordpress blog or websites, now i have converted it for blogger. Now This tutorial will show you How To Add Different/Multi Colored Popular Post Widget In blogger.
Live Demo
Popular Post Widget Series
1. Multi Colored Popular Post Widget For Blogger
Multi Colored Popular Post Gadget Preview
Multi Colored Popular Post Gadget Demo
How To Add Different/Multi Colored Popular Post Widget To Blogger
- Go to Blogger Dashboard
- Click on DropDown Menu and select Template
- Backup your Template before making any changes to your blog
- Now Click on Edit HTML --> Proceed --> Expand Widget Templates
- Press Ctrl + F and search the code shown below
/* Variable definitions
====================
====================
- Now Paste the Code shown below just below/after it
<Variable name="PopularPosts.background.color1" description="background color1" type="color" default="#fa4242" value="#ff4c54"/>
<Variable name="PopularPosts.background.color2" description="background color2" type="color" default="#ee6107" value="#ff764c"/>
<Variable name="PopularPosts.background.color3" description="background color3" type="color" default="#f0f" value="#ffde4c"/>
<Variable name="PopularPosts.background.color4" description="background color4" type="color" default="#ff0" value="#c7f25f"/>
<Variable name="PopularPosts.background.color5" description="background color5" type="color" default="#0ff" value="#33c9f7"/>
<Variable name="PopularPosts.background.color6" description="background color6" type="color" default="#ff0" value="#7ee3c7"/>
<Variable name="PopularPosts.background.color7" description="background color7" type="color" default="#ff0" value="#f6993d"/>
<Variable name="PopularPosts.background.color2" description="background color2" type="color" default="#ee6107" value="#ff764c"/>
<Variable name="PopularPosts.background.color3" description="background color3" type="color" default="#f0f" value="#ffde4c"/>
<Variable name="PopularPosts.background.color4" description="background color4" type="color" default="#ff0" value="#c7f25f"/>
<Variable name="PopularPosts.background.color5" description="background color5" type="color" default="#0ff" value="#33c9f7"/>
<Variable name="PopularPosts.background.color6" description="background color6" type="color" default="#ff0" value="#7ee3c7"/>
<Variable name="PopularPosts.background.color7" description="background color7" type="color" default="#ff0" value="#f6993d"/>
- Now Find the code shown below using [ctrl+F]
]]></b:skin>
- Now Paste the Code shown below just before/above it
#PopularPosts1 ul{margin:0;padding:5px 0;list-style-type:none}
#PopularPosts1 ul li{position:relative;margin:5px 0;border:0;padding:10px}
#PopularPosts1 ul li:first-child{background:$(PopularPosts.background.color1);width:90%}
#PopularPosts1 ul li:first-child:after{content:"1"}
#PopularPosts1 ul li:first-child + li{background:$(PopularPosts.background.color2);width:85%}
#PopularPosts1 ul li:first-child + li:after{content:"2"}
#PopularPosts1 ul li:first-child + li + li{background:$(PopularPosts.background.color3);width:80%}
#PopularPosts1 ul li:first-child + li + li:after{content:"3"}
#PopularPosts1 ul li:first-child + li + li + li{background:$(PopularPosts.background.color4);width:75%}
#PopularPosts1 ul li:first-child + li + li + li:after{content:"4"}
#PopularPosts1 ul li:first-child + li + li + li + li{background:$(PopularPosts.background.color5);width:70%}
#PopularPosts1 ul li:first-child + li + li + li + li:after{content:"5"}
#PopularPosts1 ul li:first-child + li + li + li + li +li{background:$(PopularPosts.background.color6);width:65%}
#PopularPosts1 ul li:first-child + li + li + li + li + li:after{content:"6"}
#PopularPosts1 ul li:first-child + li + li + li + li + li +li{background:$(PopularPosts.background.color7);width:60%}
#PopularPosts1 ul li:first-child + li + li + li + li + li + li:after{content:"7"}
#PopularPosts1 ul li:first-child:after,
#PopularPosts1 ul li:first-child + li:after,
#PopularPosts1 ul li:first-child + li + li:after,
#PopularPosts1 ul li:first-child + li + li + li:after,
#PopularPosts1 ul li:first-child + li + li + li + li:after,
#PopularPosts1 ul li:first-child + li + li + li + li + li:after,
#PopularPosts1 ul li:first-child + li + li + li + li + li + li:after{position:absolute;top:20px;right:-15px;border-radius:50%;background:#353535;width:30px;height:30px;line-height:1em;text-align:center;font-size:28px;color:#fff}
#PopularPosts1 ul li .item-thumbnail{float:left;border:0;margin-right:10px;background:transparent;padding:0;width:40px;height:40px}
#PopularPosts1 ul li a{font-size:12px;color:#444;text-decoration:none}
#PopularPosts1 ul li a:hover{color:#222;text-decoration:none}
#PopularPosts1 ul li{position:relative;margin:5px 0;border:0;padding:10px}
#PopularPosts1 ul li:first-child{background:$(PopularPosts.background.color1);width:90%}
#PopularPosts1 ul li:first-child:after{content:"1"}
#PopularPosts1 ul li:first-child + li{background:$(PopularPosts.background.color2);width:85%}
#PopularPosts1 ul li:first-child + li:after{content:"2"}
#PopularPosts1 ul li:first-child + li + li{background:$(PopularPosts.background.color3);width:80%}
#PopularPosts1 ul li:first-child + li + li:after{content:"3"}
#PopularPosts1 ul li:first-child + li + li + li{background:$(PopularPosts.background.color4);width:75%}
#PopularPosts1 ul li:first-child + li + li + li:after{content:"4"}
#PopularPosts1 ul li:first-child + li + li + li + li{background:$(PopularPosts.background.color5);width:70%}
#PopularPosts1 ul li:first-child + li + li + li + li:after{content:"5"}
#PopularPosts1 ul li:first-child + li + li + li + li +li{background:$(PopularPosts.background.color6);width:65%}
#PopularPosts1 ul li:first-child + li + li + li + li + li:after{content:"6"}
#PopularPosts1 ul li:first-child + li + li + li + li + li +li{background:$(PopularPosts.background.color7);width:60%}
#PopularPosts1 ul li:first-child + li + li + li + li + li + li:after{content:"7"}
#PopularPosts1 ul li:first-child:after,
#PopularPosts1 ul li:first-child + li:after,
#PopularPosts1 ul li:first-child + li + li:after,
#PopularPosts1 ul li:first-child + li + li + li:after,
#PopularPosts1 ul li:first-child + li + li + li + li:after,
#PopularPosts1 ul li:first-child + li + li + li + li + li:after,
#PopularPosts1 ul li:first-child + li + li + li + li + li + li:after{position:absolute;top:20px;right:-15px;border-radius:50%;background:#353535;width:30px;height:30px;line-height:1em;text-align:center;font-size:28px;color:#fff}
#PopularPosts1 ul li .item-thumbnail{float:left;border:0;margin-right:10px;background:transparent;padding:0;width:40px;height:40px}
#PopularPosts1 ul li a{font-size:12px;color:#444;text-decoration:none}
#PopularPosts1 ul li a:hover{color:#222;text-decoration:none}
- Now Find the code shown below using Ctrl + F
<b:section class='sidebar' id='sidebar' preferred='yes'>
- Now Paste the Code Shown Below just below/after it
<b:widget id='PopularPosts1' locked='false' title='Popular Posts' type='PopularPosts'>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content popular-posts'>
<ul>
<b:loop values='data:posts' var='post'>
<li>
<b:if cond='data:showThumbnails == "false"'>
<b:if cond='data:showSnippets == "false"'>
<a expr:href='data:post.href' expr:title='data:post.title' rel='bookmark'><data:post.title/></a>
<b:else/>
<a expr:href='data:post.href' expr:title='data:post.snippet' rel='bookmark'><data:post.title/></a>
</b:if>
<b:else/>
<b:if cond='data:showSnippets == "false"'>
<b:if cond='data:post.thumbnail'>
<img class='item-thumbnail' expr:alt='data:post.title' expr:src='data:post.thumbnail'/>
<b:else/>
<img alt='no image' class='item-thumbnail' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn_yWQ9XTfrK7m_eTfF6DJp7eY-F9i6e23YDQSQPuZwrhDzTVLM8nourSPFx30h-BWm6XwxDcqLtp0pn83NM0nCPepc9_dbELm7Z15WCkW6a5EjUvNiMcPSmkO2PUwZ4Eo_5mqLyNWiUs/s1600/defaultimage.jpg'/>
</b:if>
<a expr:href='data:post.href' expr:title='data:post.title' rel='bookmark'><data:post.title/></a>
<div class='clear'/>
<b:else/>
<b:if cond='data:post.thumbnail'>
<img class='item-thumbnail' expr:alt='data:post.title' expr:src='data:post.thumbnail'/>
<b:else/>
<img alt='no image' class='item-thumbnail' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn_yWQ9XTfrK7m_eTfF6DJp7eY-F9i6e23YDQSQPuZwrhDzTVLM8nourSPFx30h-BWm6XwxDcqLtp0pn83NM0nCPepc9_dbELm7Z15WCkW6a5EjUvNiMcPSmkO2PUwZ4Eo_5mqLyNWiUs/s1600/defaultimage.jpg'/>
</b:if>
<a expr:href='data:post.href' expr:title='data:post.snippet' rel='bookmark'><data:post.title/></a>
<div class='clear'/>
</b:if>
</b:if>
</li>
</b:loop>
</ul>
</div>
<p style="display:none;">Widget by <a href="http://www.latesthack.com">Latest Hack</a></p>
</b:includable>
</b:widget>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content popular-posts'>
<ul>
<b:loop values='data:posts' var='post'>
<li>
<b:if cond='data:showThumbnails == "false"'>
<b:if cond='data:showSnippets == "false"'>
<a expr:href='data:post.href' expr:title='data:post.title' rel='bookmark'><data:post.title/></a>
<b:else/>
<a expr:href='data:post.href' expr:title='data:post.snippet' rel='bookmark'><data:post.title/></a>
</b:if>
<b:else/>
<b:if cond='data:showSnippets == "false"'>
<b:if cond='data:post.thumbnail'>
<img class='item-thumbnail' expr:alt='data:post.title' expr:src='data:post.thumbnail'/>
<b:else/>
<img alt='no image' class='item-thumbnail' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn_yWQ9XTfrK7m_eTfF6DJp7eY-F9i6e23YDQSQPuZwrhDzTVLM8nourSPFx30h-BWm6XwxDcqLtp0pn83NM0nCPepc9_dbELm7Z15WCkW6a5EjUvNiMcPSmkO2PUwZ4Eo_5mqLyNWiUs/s1600/defaultimage.jpg'/>
</b:if>
<a expr:href='data:post.href' expr:title='data:post.title' rel='bookmark'><data:post.title/></a>
<div class='clear'/>
<b:else/>
<b:if cond='data:post.thumbnail'>
<img class='item-thumbnail' expr:alt='data:post.title' expr:src='data:post.thumbnail'/>
<b:else/>
<img alt='no image' class='item-thumbnail' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn_yWQ9XTfrK7m_eTfF6DJp7eY-F9i6e23YDQSQPuZwrhDzTVLM8nourSPFx30h-BWm6XwxDcqLtp0pn83NM0nCPepc9_dbELm7Z15WCkW6a5EjUvNiMcPSmkO2PUwZ4Eo_5mqLyNWiUs/s1600/defaultimage.jpg'/>
</b:if>
<a expr:href='data:post.href' expr:title='data:post.snippet' rel='bookmark'><data:post.title/></a>
<div class='clear'/>
</b:if>
</b:if>
</li>
</b:loop>
</ul>
</div>
<p style="display:none;">Widget by <a href="http://www.latesthack.com">Latest Hack</a></p>
</b:includable>
</b:widget>
- Now save your template
Settings
- Go to Blogger Dashboard --> Design --> Page Elements
- Click on the edit link of Popular Posts widget
- Select "display up to 7 posts".
- Now Save the widget
Customization Of Populer Post Color
- Go to Design >> Template Designer >> Advanced >> PopularPostsBackground
- Then Select any color you want
38 comments
hi friend how are you today, i liked this post,
and i wish you help to add this addition on your wiste because i like it so much and i don't know how to add it into my blogspot
thanks
this is the addition
http://3.bp.blogspot.com/-hkFU2OqchYI/T319oTOmHtI/AAAAAAAAAKI/7FX_e1C0G2o/s1600/Sans%2Btitre%2B4.bmp
@zakri abdeI do not understand what you're asking
@sonu
i want to add like your footer
i am not able to find out this in my Edit HTML section on my blog http://governmentandpvtnaukri.blogspot.in/ please help me out
i sended my template to given email please do needful
@Nitin DwivediFixed and sent back to you
thanks a alots
Can u Please Make My Blog SEO Friendly and also Related post wchich i was not able to do ..
@sonu
Can i send my xml to get my comment style like u,:)
@Octopurbai will post on threaded comments as soon as possible
hi i tried many time but it doesn't work. giving me an error. Please help me.. http://www.vidzpro.com/
@sonu
I have send you email yesterday from vidzprohd@gmail.com with my templates backup please check it.
www.vidzpro.com
@Vidz ProFixed and sent back to you
thanks you so much for fixing my templates. Now it is looking great.I have another question that currently i am showing 5 post in my popular post so if i increase 5 to 7/10 then will it be there any problem?
http://www.vidzpro.com/
@Vidz ProYou can increase upto 7 posts. This widget works fine upto 7 posts
I Did Not Find This CODE in Template
What can I Do !
/* Variable definitions
====================
I Have Same Template Like Your i.e Fully CSS
@AnonymousYou can put it above ]]></b:skin>
@sonu
It Show this Error
Invalid variable declaration in page skin: Variable is used but not defined. Input: PopularPosts.background.color7
Error 500
Invalid variable declaration in page skin: Variable is used but not defined. Input: PopularPosts.background.color7
Error 500
this will happen on template
My blog http://www.techparadise.info/ i have done everything but their is no option of PopularPostsBackground under the template-desginer advanced option...
@Janmejai Pratap SinghYou forgot to add variables in your template
@sonu
Thanks for reminding.....
I cannot find /* Variable definitions
====================
please help me :(
@Hyuga FahmiYou can put it above ]]></b:skin>
@sonu
I've put it, and follow step by step but still doesn't work. Can I send my template to you? please.. :(
@Hyuga FahmiSend me your template
@Hyuga Fahmi
i just put it in my blog.. it's doesn't word... then i try removed this:
and this:
its work!!! u should try ...
@sonu
thanks a lot bro... its verry nice tutorial... kee it alife all the time
Hi my friend thanks for this wonderful tutorial, I have sent you my template in .xml so you can help me fix it.
Waiting for your reply
@Kelechi Nwachukwu Fixed and sent back to you
doesn't display very well on my home pages but it display well in post pages why?
@ahmed Onawale I have checked your website it displays well in the homepage of your blog
When I Put "Save Template/Save Model" on EDIT HTML the blog goes to a white page/blank page.. :/
What should I do?
I also tried other multi color popular posts and I cant add..
I'm waiting reply,
Thanks!
@MNPHOST I have changed some code. Reinstall this widget, it will work fine
@sonu
I still cant add the widget. Its goes to a blank page.. :/
@MNPHOST Send me your template, i will add it
Click to Add a New Comment