If you are using Blogger default comment system (not threaded comment ) , you might see an error : comment pagination not shown for posts with 200+ comments .
What is comment pagination ? In the picture above ,I marked a circle around comment pagination .
So what is the solution for posts with more than 200+ comments ?


Yes ,blogger team said that they has an API for comment pagination ,but I don't know why it doesn't work in my blog . For example , my post on Simplex Enews template has 250 comments ,and I added comment pagination code into template , but I see no comment pagination appear . It only show first 200 comments and their no way to move to the last 50 comments .
So I decided to make it myself ,add a little javascript into template for comment pagination . Fortunately ,it work ,so I think it maybe helpful to you in case your blog use default comment system and your post has more than 200 comments :D

Here are steps for making a comment pagination as I did ^^ pls backup before follow steps bellow ,because at least we have a way to comeback .

1,Go to Dashboard - > Template -> Edit HTML .

2,Add these line right before ]]></b:skin>

#commentpaging {float:right;}
#commentpaging a {margin-right:5px;}


3,Add the code bellow before <body>

<script type='text/javascript'>
//<![CDATA[
function commentpagination(url,comment){
 var posturl= url;
 var comment = comment;
 cmpage = Math.ceil(comment/200);
 document.write('<a href="'+posturl+'?commentPage=1">Oldest</a>');
 for (var i = 1; i <= cmpage; i++) {
    document.write('<a href="'+posturl+'?commentPage='+i+'">'+i+'</a>');
 }
 document.write('<a href="'+posturl+'?commentPage='+cmpage+'">Latest</a>');
}

//]]>
</script>


4, Find this line
<b:includable id='comments' var='post'>
and add these code right after the line above
<span id='commentpaging'>
                                     Comment Page :
                                     <script type='text/javascript'>commentpagination(&quot;<data:post.url/>&quot;,&quot;<data:post.numComments/>&quot;);</script>                                       
                                 </span>

So here is what you got
<b:includable id='comments' var='post'>
<span id='commentpaging'>
                                     Comment Page :
                                     <script type='text/javascript'>commentpagination(&quot;<data:post.url/>&quot;,&quot;<data:post.numComments/>&quot;);</script>                                       
                                 </span>


5,Save template . That's all .

How it work


First ,this script will take the number of comment in  a post ,and than divide by 200 . Round up the result to the nearest integer ,we will get the number of comment pages .
For example ,if my post has 250 comments :
250/200 = 1.25 -> round up -> 2
So the comment page 1 contain first 200 comments and the comment page 2 contain the last 50 comments .
The url to a comment page has structure :
http:// post url .html?commentPage=comment page number
for example ,here is the url of comment page 2 in my blog
http://www.thesimplexdesign.com/2011/02/simplexenews-latest-version-fixed.html?commentPage=2

When we get the number of comment page ,and comment page url structure ,the next step is very simple ,just write down all comment page with a loop statement .

It's the way this code work . Hope this helpful to you

Share this post

Advertisement

22 comments

  1. Thanks!
    Can we change the blogger comment form to look like this?

    ReplyDelete
    Replies
    1. yes,Blogger user can use the threaded comment instead of default comment system as before . You can search in Google or get more information in buzz.blogger.com (official blog of blogger team),and know how to enable this function .

      Delete
    2. Thanks for your response!

      But I mean it will look like this in the screenshot (Name + Mail + Website + Comment )

      Delete
    3. there's no way to do that ,friend . Blogger give us two ways to login name+URL and OpenID login . You can try them :D

      Delete
  2. It not work in my blog,

    i dont see pagination in my post http://www.tergaptek.com/2010/01/tukeran-link.html

    ReplyDelete
    Replies
    1. this script is only applied to Blogger default comment system which comment pagination doesn't show when comment number over 200+
      If you are using Blogger threaded comment ,there's a script for load more comment ( like Load more in Facebook ) , you will see a load more link bellow comment form,so we use this script for what ? :D

      Delete
    2. That meant when threaded comment enabled, this is not needede?

      Delete
  3. Hi,

    I tried to use threaded commenting but it seems my template is very diffrent and I could not find out reuired statements in that.

    Could you please help me out to rectify this problem??

    I shall be very thankful to you for this act of kindness! :)

    ReplyDelete
    Replies
    1. check the expand widgets template in edit HTML mode ,and you can find the code .
      What template are u using ?

      Delete
  4. from the above explanation that the first page there are 200 comments and 50 comments on the next page.
    I want to ask is what if I want only 10 comments are displayed on the first page and 10 comments on the next page?

    ReplyDelete
    Replies
    1. I've never thought about this . Pls give me time ^^
      Thanks for your suggestion .

      Delete
  5. When I add this code, will it immediately apply to old posts or only newer ones?
    I have done all the steps, but going back to an old post that has over 500 comments, pagination is not showing up.

    ReplyDelete
    Replies
    1. I am also having same problem. Still it does not show Pagination on my old post..

      Delete
  6. @admin : But in my template , it just show "load", not show any comment if more than 148 komen.

    ReplyDelete
  7. Thank you so much for this tutorial. :) Nice tutorial. It works on my blog

    ReplyDelete
  8. doesn't work :/
    I have the same problem, I've got over 200 comments and the newest don't show, but not a single comment navigation sorta thing WORKS!! :(
    Here's my link
    http://littlespaceheroesfansite.blogspot.com.au/p/graphics.html
    All there is, is a 'load more' button and that's all... IT DOESN'T EVEN WORK

    ReplyDelete

Here are some rules for commenting on Simplex Design blog :
1, Search first ,then ask question. You will get the answer faster
2, All comments except spams are welcome.
3, Please make all requests in English.
4, Do not use generic titles such as Admin or Mod. This confuses readers