Add Different/Multi Colored Popular Post Widget In blogger blog

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.

Popular Post Widget Series
1. Multi Colored Popular Post Widget For Blogger


Multi Colored Popular Post Gadget Preview



Multi Colored Popular Post Gadget Demo


Live 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"/>

  • 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}

  • 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 == &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/>
         <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 == &quot;false&quot;'>
         <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

Like it? Share it.

38 comments

Anonymous
6 April 2012 at 04:59

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

Anonymous
6 April 2012 at 05:00

this is the addition
http://3.bp.blogspot.com/-hkFU2OqchYI/T319oTOmHtI/AAAAAAAAAKI/7FX_e1C0G2o/s1600/Sans%2Btitre%2B4.bmp

6 April 2012 at 06:02 Author

@zakri abdeI do not understand what you're asking

Anonymous
6 April 2012 at 10:57

@sonu

i want to add like your footer

Anonymous
6 April 2012 at 21:51

i am not able to find out this in my Edit HTML section on my blog http://governmentandpvtnaukri.blogspot.in/ please help me out

Anonymous
7 April 2012 at 03:20

i sended my template to given email please do needful

7 April 2012 at 03:57 Author

@Nitin DwivediFixed and sent back to you

Anonymous
7 April 2012 at 03:59

thanks a alots

Anonymous
7 April 2012 at 04:21

Can u Please Make My Blog SEO Friendly and also Related post wchich i was not able to do ..

10 April 2012 at 10:24

@sonu
Can i send my xml to get my comment style like u,:)

10 April 2012 at 10:31 Author

@Octopurbai will post on threaded comments as soon as possible

18 April 2012 at 01:06 Author

hi i tried many time but it doesn't work. giving me an error. Please help me.. http://www.vidzpro.com/

18 April 2012 at 22:50 Author

@sonu

I have send you email yesterday from vidzprohd@gmail.com with my templates backup please check it.

www.vidzpro.com

18 April 2012 at 23:21 Author

@Vidz ProFixed and sent back to you

19 April 2012 at 02:32 Author

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/

19 April 2012 at 02:53 Author

@Vidz ProYou can increase upto 7 posts. This widget works fine upto 7 posts

Anonymous
30 April 2012 at 03:21

I Did Not Find This CODE in Template
What can I Do !

/* Variable definitions
====================

I Have Same Template Like Your i.e Fully CSS

30 April 2012 at 03:50 Author

@AnonymousYou can put it above ]]></b:skin>

Anonymous
30 April 2012 at 07:26

@sonu
It Show this Error

Invalid variable declaration in page skin: Variable is used but not defined. Input: PopularPosts.background.color7

Error 500

Anonymous
30 April 2012 at 07:27

Invalid variable declaration in page skin: Variable is used but not defined. Input: PopularPosts.background.color7

Error 500

this will happen on template

1 May 2012 at 10:58

My blog http://www.techparadise.info/ i have done everything but their is no option of PopularPostsBackground under the template-desginer advanced option...

1 May 2012 at 11:11 Author

@Janmejai Pratap SinghYou forgot to add variables in your template

3 May 2012 at 08:14

@sonu
Thanks for reminding.....

27 May 2012 at 07:34 Author

I cannot find /* Variable definitions
====================
please help me :(

27 May 2012 at 08:20 Author

@Hyuga FahmiYou can put it above ]]></b:skin>

28 May 2012 at 03:51 Author

@sonu
I've put it, and follow step by step but still doesn't work. Can I send my template to you? please.. :(

28 May 2012 at 04:52 Author

@Hyuga FahmiSend me your template

1 June 2012 at 12:24

@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 ...

1 June 2012 at 12:26

@sonu

thanks a lot bro... its verry nice tutorial... kee it alife all the time

11 June 2012 at 02:31

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

11 June 2012 at 03:21 Author

@Kelechi Nwachukwu Fixed and sent back to you

Anonymous
16 July 2012 at 14:49

doesn't display very well on my home pages but it display well in post pages why?

17 July 2012 at 02:37 Author

@ahmed Onawale I have checked your website it displays well in the homepage of your blog

Anonymous
16 September 2012 at 16:18

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!

17 September 2012 at 01:49 Author

@MNPHOST I have changed some code. Reinstall this widget, it will work fine

Anonymous
17 September 2012 at 05:52

@sonu
I still cant add the widget. Its goes to a blank page.. :/

17 September 2012 at 08:50 Author

@MNPHOST Send me your template, i will add it

Click to Add a New Comment

  • If you're asking a question click on Subscribe By Email link, on the comment form, to be notified of replies.
  • Do NOT add links to the body of your comment as they will not be published.
  • Only the comments posted in ENGLISH will be approved.
  • If you have a problem check first the comments , maybe you will find the solution there.