Menu

Lovely Cute
  • More Menu

    • Reports
    • Search
    • Graphs
    • Settings
  • Dream Fun Product

    Drop Menu

    • Reports
    • Search
    • Graphs
    • Settings
  • Home
  • About
  • Contact
  • Sitemap
  • Others
    • Gambar Lucu
    • Infografis
    • Inspirasi
    • Motivasi
    • Photoshop
    • Teka-teki
    • Tips
    • Ucapan

Quicker BD

  • Menu
  • Home
  • Blogger
    • SEO
      • SEO 1
      • SEO 2
    • CSS
      • CSS 1
      • CSS 2
      • CSS 3
      • CSS 4
      • CSS 5
    • Jquery
      • Jquery 1
      • Jquery 2
  • Music
    • Product 1
      • Sub Item
      • Sub Item
    • Product 2
      • Sub Item
      • Sub Item
  • Flat UI
  • Features
Home » Blogger CSS » Blogger Tutorial » Blogger Widget » How-to » How to Add Multi-Colored Popular Posts to Blogger

How to Add Multi-Colored Popular Posts to Blogger

In our previous posts we have already saw two tutorial about popular posts widget of blogger. if you are new to this blog then you may also like check these tutorials, 1. How to add Blogger's Official Popular Posts widget to blogger and 2. How to add Custom Popular posts widget to blogger.

Well, now let's move and talk about today's tutorial, here we are going to share an another tutorial on popular post widget of blogger. Well, as we know official popular posts widget displays most viewed post of our blog in the last 7 days, last month and of all time. You have three options to choose the mode of this widget like : display title only, display title with image thumbnail or display title along with the posts snippets.

So, here we will add a new variable and some CSS codes to our blogger template, In order to customize it and look a multi-colored popular posts widget. So let's begin:


Also see : Random Posts Displaying Button for Blogger

Adding multi-colored popular posts to Blogger

Go to Blogger Dashboard > Template > Edit HTML
Press CTRL + F to enable search box then search for following tag :

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

Note: If you can't find it, paste it below the autor information that is usually below this tag (CTRL + F):


 <b:skin><![CDATA[/* 

...and should end up with this symbol:


 ----------------------------------------------- */

Paste below code just after it.
<Group description="PopularPosts Backgrounds" selector="#PopularPosts1">
<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"/>
</Group>

Next, search for the following code :

]]></b:skin>

Just above/before it, add this code:


#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: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{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 following code:

<b:widget id='PopularPosts1' locked='false' title='Popular Posts' type='PopularPosts'>

Delete it until you reach at this tag (delete the </b:widget> also):

 </b:widget>

Note: Be very careful when removing it. The entire fragment of code should look like this:
    <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;'>
                <!-- (1) No snippet/thumbnail -->
                <a expr:href='data:post.href'><data:post.title/></a>
              <b:else/>
                <!-- (2) Show only snippets -->
                <div class='item-title'><a expr:href='data:post.href'><data:post.title/></a></div>
                <div class='item-snippet'><data:post.snippet/></div>
              </b:if>
            <b:else/>
              <b:if cond='data:showSnippets == &quot;false&quot;'>
                <!-- (3) Show only thumbnails -->
                <div class='item-thumbnail-only'>
                  <b:if cond='data:post.thumbnail'>
                    <div class='item-thumbnail'>
                      <a expr:href='data:post.href' target='_blank'>
                        <img alt='' border='0' expr:height='data:thumbnailSize' expr:src='data:post.thumbnail' expr:width='data:thumbnailSize'/>
                      </a>
                    </div>
                  </b:if>
                  <div class='item-title'><a expr:href='data:post.href'><data:post.title/></a></div>
                </div>
                <div style='clear: both;'/>
              <b:else/>
                <!-- (4) Show snippets and thumbnails -->
                <div class='item-content'>
                  <b:if cond='data:post.thumbnail'>
                    <div class='item-thumbnail'>
                      <a expr:href='data:post.href' target='_blank'>
                        <img alt='' border='0' expr:height='data:thumbnailSize' expr:src='data:post.thumbnail' expr:width='data:thumbnailSize'/>
                      </a>
                    </div>
                  </b:if>
                  <div class='item-title'><a expr:href='data:post.href'><data:post.title/></a></div>
                  <div class='item-snippet'><data:post.snippet/></div>
                </div>
                <div style='clear: both;'/>
              </b:if>
            </b:if>
          </li>
          </b:loop>
        </ul>
        <b:include name='quickedit'/>
      </div>
    </b:includable>
    </b:widget>


After you have deleted the above code, paste the following in its place:

    <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/AVvXsEgkOxPtau9ya-ObXwQVD7VKj4wlUCajtOtLAM9_bZy5Fv4-bnyj1IsuYSYDhHGMDhQJ1lysn2bbgUJS16icUmWaR65LKvViGpNj9SWL-joGhmLB6dySro-YtMRQbDNuTxaXhQpBsN-blPM/s1600/default.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/AVvXsEgkOxPtau9ya-ObXwQVD7VKj4wlUCajtOtLAM9_bZy5Fv4-bnyj1IsuYSYDhHGMDhQJ1lysn2bbgUJS16icUmWaR65LKvViGpNj9SWL-joGhmLB6dySro-YtMRQbDNuTxaXhQpBsN-blPM/s1600/default.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>
      </b:includable>
    </b:widget>

Save template.

Changes :
- Go back to Layout and click on the edit link of Popular Posts widget.
Select to "display up to 5 posts", then Save the widget.


- You can easily change the background color of the popular posts widget, going to Template > Customize > Advanced > PopularPostsBackground and there you can select any color you want.


You have done !! :)

Drop your questions and comments below
Add Comment
Blogger CSS Blogger Tutorial Blogger Widget How-to

Share

Like

G+

Tweet

Tweet
Related Posts

Show Conversion CodesHide Conversion Codes
Show EmoticonHide Emoticon
Newer Older Home
Powered by Blogger.

Weekly Posts

  • How to Add A Transparent Notification Bar To Blogger
    How to Add A Transparent Notification Bar To Blogger
  • Xmas "Flying Santa Claus" Widget for Blogger
    Xmas "Flying Santa Claus" Widget for Blogger
  • Supreme V2 ( Version 2) Responsive Blogger Template Download for free
    Supreme V2 ( Version 2) Responsive Blogger Template Download for free
  • How to Embed YouTube Videos In Blogger Posts
    How to Embed YouTube Videos In Blogger Posts
  • How to Add Animated Flying Android Man Widget to Blogger
    How to Add Animated Flying Android Man Widget to Blogger
  • Create a Free Blog with Blogspot.com
    Create a Free Blog with Blogspot.com
  • Simple Recent Posts Widget for Blogger / Blogspot
    Simple Recent Posts Widget for Blogger / Blogspot
  • Add Neat CSS3 Drop Down Menu in Blogger
    Add Neat CSS3 Drop Down Menu in Blogger
  • Use A Drop Cap Large First Letter In Posts On Blogger
    Use A Drop Cap Large First Letter In Posts On Blogger
  • How to Prepare and Upload Videos to Blogger
    How to Prepare and Upload Videos to Blogger

Blog Archive

  • ►  2017 (2)
    • ►  October (1)
    • ►  May (1)
  • ►  2016 (5)
    • ►  October (1)
    • ►  September (1)
    • ►  March (1)
    • ►  February (2)
  • ►  2015 (28)
    • ►  November (1)
    • ►  September (7)
    • ►  August (2)
    • ►  July (1)
    • ►  June (1)
    • ►  April (3)
    • ►  March (3)
    • ►  February (5)
    • ►  January (5)
  • ▼  2014 (105)
    • ►  December (4)
    • ►  November (6)
    • ►  October (1)
    • ▼  September (8)
      • Marvel Blogger Template with Grid Layout Download ...
      • Stylish Email Subscription Box Widget for Blogger
      • SEO Optimized Free Blogger Templates 2014 (Respons...
      • Add an Instagram Widget In Blogger
      • Upload and Use Custom Fonts in Blogger
      • How to Add Multi-Colored Popular Posts to Blogger
      • Random Posts Displaying Button for Blogger
      • Add Random Posts In Blogger to Increase the PageViews
    • ►  August (12)
    • ►  July (14)
    • ►  June (5)
    • ►  May (11)
    • ►  April (5)
    • ►  March (15)
    • ►  February (24)

Labels

  • Facebook
  • twitter
  • googleplus
  • linkedin
  • youtube
  • flickr
  • vimeo
  • deviantart

Copyright Quicker BD 2018

Published By Gooyaabi Templates