2

I am using wp_list_comments(); function to list all the comments, but I want to add some pagination, for example 10 on one page.

I tried "Break comments into pages..." in Discussion panel but it sorts them werid...

Also I have added paginate_comments_links() but it doesn't work

2

Put below code into your current theme's comments.php file:

<div class="navigation">
    <?php paginate_comments_links(); ?> 
</div>

<ol class="commentlist">
    <?php wp_list_comments(); ?>
</ol>

<div class="navigation">
    <?php paginate_comments_links(); ?> 
</div>

This code will display pagination as you expect. Don't forgot to check the break comment to part with number of settings from Admin > Settings > Discussion Settings. See below example snap.

enter image description here

I tested this code and this should work for you also. You can check more detail about paginate_comments_links here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.