Codex

Template Tags/paginate comments links

Contents

Description

Generate a new way to list the paged comments in the comment template. Instead of using Previous or Next Comments links, it displays a full list of comment pages using numeric indexes.

This is probably the most efficient way to paginate comments in Wordpres 2.7 since it allows the users to select wich comment page wants to visit instead of clicking trough every single page using the next/prev links.

Example:

 1 2 3 ... 10 Next >> 

Usage

 <?php paginate_comments_links(); ?> 


Parameters

Needs Further Completion

'base' => add_query_arg( 'cpage', '%#%' ),
'format' => ,
'total' => $max_page,
'current' => $page,
'echo' => true,
'add_fragment' => '#comments'

Styling

The function prints several css classes for further CSS styiling:

.page-numbers 
.current
.next
.prev

Example Source Code

<span class='page-numbers current'>1</span>
 <a class='page-numbers' href='http://www.site.com/post-slug/comment-page-2/#comments'>2</a>
 <a class='next page-numbers' href='http://www.site.com/post-slug/comment-page-2/#comments'>Next »</a>

Working Example

http://www.lagzero.net/2008/12/descarga-el-parche-de-gta-iv-para-pc-gta-iv-pc-v1010/#comments

Uses in the Default Theme

The following code uses this function to create the Comments Pages index in the Default Theme's comments.php:

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

Change Log

Since: 2.7.0

Related

comments_number, comments_link, comments_rss_link, comments_popup_script, comments_popup_link, comment_ID, comment_author, comment_author_IP, comment_author_email, comment_author_url, comment_author_email_link, comment_author_url_link, comment_author_link, comment_type, comment_text, comment_excerpt, comment_date, comment_time, comment_author_rss, comment_text_rss, permalink_comments_rss, wp_list_comments, comment_reply_link, cancel_comment_reply_link, comment_form_title, comment_id_fields, previous_comments_link, next_comments_link, paginate_comments_links

See also index of Function Reference and index of Template Tags.