Add Multi-Colored Popular Posts to Blogger



Popular Posts is a widget provided by Blogger that displays the most visited posts on the blog from the last 7 days, last month or all time. There are three ways to display it: 

1. Display only post title
2. Display title with image thumbnails and snippets
3. Display post title with image thumbnail
4. Display title with snippets.

To customize this multi-colored popular posts widget, we have to add new variables and some CSS codes to our Blogger template. So let's begin adding it...

How to add multi-colored popular posts to Blogger

Step 1. Login to your Blogger Dashboard, go to "Template" and hit the "Edit HTML" button.




Step 2. Click anywhere inside the code area and press the CTRL + F keys to open the editor' search box.

Step 3. Search for the following text:

Variable definitions

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

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

...and should end up with a similar line:

----------------------------------------------- */ 
Step 4. Copy and paste just below/after this tag the next code:

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

Step 5. Now that we added the variables to allow us changing the colors, search for the following tag:

]]></b:skin>

Step 6. 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}

Step 7. Now find the following code:

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

Step 8. Delete it until you see this tag (delete the </b:widget> tag as well):

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

Step 9. 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/AVvXsEjxKRrPFN2yECY30A9XPxl2EW0DkpUVKvXOnV248gQe8XHZ2X1IlYmqITEm-NVLl9t2781qHaaSZPcFiSbTQerrR3pB58s2YlV9BvKsu8bGdG35QWHnUJ6IZERw0pfO9_rUe4x07wcQ3No/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/AVvXsEjxKRrPFN2yECY30A9XPxl2EW0DkpUVKvXOnV248gQe8XHZ2X1IlYmqITEm-NVLl9t2781qHaaSZPcFiSbTQerrR3pB58s2YlV9BvKsu8bGdG35QWHnUJ6IZERw0pfO9_rUe4x07wcQ3No/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>

Step 10. To save the widget, click the 'Save template' button.

Multi-colored Popular Posts Settings

- Go back to Layout and click the "edit" link on the 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 by going to "Template", click the Customize" button and go to the "Advanced" tab. There you should find the "PopularPostsBackground" title from where you can select any color you want.


You're done!

If you enjoy reading this blog, please like & subscribe for more tutorials. For any questions or suggestions, leave a comment below.

COMMENTS

BLOGGER
Name

Ad Networks,4,Adsense,3,Adsense Alternative,2,Affiliate Marketing,3,ARTICLE WRITING,3,Aweber,1,BACKLINKING,1,Bitcoins,1,BLOG DESIGN,5,BLOGGER,19,BLOGGER NOTIFICATIONS,2,BLOGGER PLUGINS,23,BLOGGER POSTS,3,BLOGGER WIDGETS,16,Blogging,8,BLOGGING TIPS,28,Bluehost,1,Chitika,1,CHRISTMAS DECORATION,1,COMMENTS,2,Coupons,1,Email Marketing,2,FACEBOOK,3,Freelancing,1,GCS,1,Grammarly,1,help,1,How To,2,important points,1,JQUERY,2,Links,1,Make Money Online,14,NAVIGATION,1,New Year 2017,1,Nofollow Links,1,NOTIFICATIONS,1,online,2,Other,1,Outreach Emails,1,Parental control,1,POPULAR POSTS,1,Privacy,1,Review,5,RSS Feed,1,secure,1,seo,13,Shortcode,1,SOCIAL MEDIA,9,Start A Blog,3,Tech News,1,Tech Tips,2,TEMPLATE CUSTOMIZATION,15,Top Softwares,1,TRAFFIC TIPS,7,Web Hosting,2,WEBMASTER TOOLS,4,widgets,32,WordPress Plugins,1,WordzPress,1,WP THEMES,1,YouTube,2,
ltr
item
HV BLOGGERS: Add Multi-Colored Popular Posts to Blogger
Add Multi-Colored Popular Posts to Blogger
https://3.bp.blogspot.com/-RAf0ZKUByvg/WFYJdWxrD1I/AAAAAAAABOk/aiHTtnIJMMEygl06519QHo9g-qPjmGQvwCLcB/s320/add%2Bcolored%2Bpopular%2Bposts%2Bfor%2Bblogger%2Bwith%2Bnumbers.png
https://3.bp.blogspot.com/-RAf0ZKUByvg/WFYJdWxrD1I/AAAAAAAABOk/aiHTtnIJMMEygl06519QHo9g-qPjmGQvwCLcB/s72-c/add%2Bcolored%2Bpopular%2Bposts%2Bfor%2Bblogger%2Bwith%2Bnumbers.png
HV BLOGGERS
https://hvbloggers.blogspot.com/2016/12/add-multi-colored-popular-posts-to_2.html
https://hvbloggers.blogspot.com/
https://hvbloggers.blogspot.com/
https://hvbloggers.blogspot.com/2016/12/add-multi-colored-popular-posts-to_2.html
true
4122661956596859215
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy