WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
<?php paginate_comments_links(array('prev_text' => '«', 'next_text' => '»')); ?>

Using above in Wordpress theme to add comment pagination links - this displays as

« 1 ... 4 5 6

"1" being the first page of comments and "6" being the last. I'd like to get something like this...

(first) « 1 2 3 » (last)

share|improve this question

The number for the first page is always 1. The number of maximum pages can be set to $max_page by calling get_comment_pages_count():

 $max_page = get_comment_pages_count();

Probably this information helps on how to build links on top of that, which depends a bit on the style of your theme. For building links, I could not find any suitable function in the Worpdress API so far, the most promising seems paginate_links() to me.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.