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
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
Share Improve this question asked Sep 20, 2016 at 11:12 DavidDavid 872 silver badges15 bronze badges 2- Hi David.. Without a shadow of doubt my part, this question will get either put on hold, downvoted or flagged in some other way. I'm going to give you alink to read about how WPSE works, I found it very interesting, especially the answer from Rarst. meta.wordpress.stackexchange/questions/4275/… – Malisa Commented Sep 20, 2016 at 11:17
- The codex already provide pagination args for comments? codex.wordpress/Function_Reference/wp_list_comments – Ahmed Fouad Commented Sep 20, 2016 at 12:03
1 Answer
Reset to default 2Put 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.
I tested this code and this should work for you also. You can check more detail about paginate_comments_links here.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745048092a4608219.html
评论列表(0条)