Display Popular Posts on Blogger Homepage

A blog's output is unpredictable, and when a post does become popular I would like it to stay up a while longer and be recommended to "passers-by". So I also wanted the popular posts to show up on the front page.

It happens that while modifying removing the back button outside the front page in the previous post, I came across the data:view.isSingleItem condition. So I assumed that hiding the popular posts on the front page is governed by the same condition. Sure enough, after some searching and testing the change, the popular posts now show up on the front page.

Modify the Blogger template

Blogger change the HTML template Blogger修改HTML模板

Search for "PopularPosts1" and make the following change:

Before the change

<b:widget cond='data:view.isSingleItem and data:posts any (p =&gt; p.id != data:view.postId)' id='PopularPosts1' locked='true' title='' type='PopularPosts' version='2' visible='true'>

After the change
(delete the red part)

<b:widget cond='data:posts any (p =&gt; p.id != data:view.postId)' id='PopularPosts1' locked='true' title='' type='PopularPosts' version='2' visible='true'>

Edit blogger HTML template to display Popular Posts on front page 修改blogger的HTML模板以在首页显示热门博文

Final result

Blogger displays Popular Posts on front page Blogger在首页显示热门博文


Comments