paginate_comments_links

Sponsored Link

コメントテンプレートにコメントのページングリストを新しい方法で生成します。
前または次のコメントリンクを使用する代わりに、数値インデックスを使用してコメントページの完全なリストを表示します。

これは恐らくWordPressの2.7以降にページ分割する最も効率的な方法です。それは、次/前へのリンクを使用する全てのシングルページを通して、クリックする代わりに訪問したいコメントページを選択するためのユーザーを許可します。

Sponsored Link

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 WordPress 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.

1 2 3 … 10 Next >>

paginate_comments_linksのテンプレートタグ使用方法

<?php paginate_comments_links(); ?> 

paginate_comments_linksのパラメーター

ニーズさらに補完

Needs Further Completion

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

より詳細な情報といくつかの使用例については、Function_Reference / paginate_comments_linksを参照してください。

See Function_Reference/paginate_comments_links for further information and some usage examples.

スタイリング

さらにCSSのstyilingためのいくつかのCSSクラスを関数を出力します:

The function prints several css classes for further CSS styiling:

.page-numbers 
.current
.next
.prev

ソースコード例

<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>

作業例

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

デフォルトのテーマで使用します

次のコードはデフォルトのテーマのcomments.phpにあるコメントページのインデックスを作成するこの関数を使用します:

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>

変更ログ

Since: 2.7.0

関連テンプレートタグ

  • Migrating Plugins and Themes to 2.7/Enhanced Comment Display – Comments Paging Links
  • Administration Panels > Settings > Discussion – Other comment settings

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

Sponsored Link