Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
<?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

1 Answer 1

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

 
discard

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