• 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細

このWikiはいつでも誰でも編集できます

「インクルードタグ/comments template」の版間の差分

提供: WordPress Codex 日本語版
移動先: 案内検索
(en:Function Reference/comments_template 11:28, 15 September 2010 bono 版を翻訳用にコピー)
 
(テンプレガイド挿入等)
1行目: 1行目:
==Description==
+
{{NeedTrans}}
 +
{{テンプレートタグガイド|PHP}}
 +
 
 +
== 説明 ==
  
 
Loads the comment template.  For use in single post and [[Pages|Page]] displays.
 
Loads the comment template.  For use in single post and [[Pages|Page]] displays.
  
==Usage==
+
== 書き方 <span id="Usage"></span>==
%%%<?php comments_template( $file, $separate_comments ); ?>%%%
+
<?php comments_template( $file, $separate_comments ); ?>
  
==Parameters==
+
== パラメータ <span id="Parameters"></span>==
 
{{Parameter|$file|string|The file to load|optional|/comments.php}}
 
{{Parameter|$file|string|The file to load|optional|/comments.php}}
 
{{Parameter|$separate_comments|boolean|Whether to separate the comments by comment type.|optional|false}}
 
{{Parameter|$separate_comments|boolean|Whether to separate the comments by comment type.|optional|false}}
  
==Examples==
+
== 用例 <span id="Examples"></span>==
  
===Alternative Comment Template===
+
===Alternative Comment Template <span id="Alternative_Comment_Template"></span>===
 
On some occasions you may want display your comments differently within your [[Theme Development|Theme]]. For this you would build an alternate file (ex. short-comments.php) and call it as follows:
 
On some occasions you may want display your comments differently within your [[Theme Development|Theme]]. For this you would build an alternate file (ex. short-comments.php) and call it as follows:
  
32行目: 35行目:
 
<tt>comments_template()</tt> is located in {{Trac|wp-includes/comment-template.php}}.
 
<tt>comments_template()</tt> is located in {{Trac|wp-includes/comment-template.php}}.
  
==Related==
+
{{原文|Function Reference/comments_template|92979}}<!-- 11:28, 15 September 2010 bono 版 -->
  
{{Include Tags}}
+
== 関連項目 ==
  
 +
{{Include Tags}}
 
{{Tag Footer}}
 
{{Tag Footer}}
  
{{原文|Function Reference/comments_template|92979}}<!-- 11:28, 15 September 2010 bono 版 -->
+
== 外部資料 ==
 +
 
 +
<!-- 参考になるページがあればリンクを -->
  
[[Category:Functions]]
+
{{DEFAULTSORT:Comments_template}}
 +
[[Category:関数]]
 +
[[Category:コーディング基準]]
  
 
[[en:Function Reference/comments_template]]
 
[[en:Function Reference/comments_template]]

2010年9月15日 (水) 20:46時点における版

このページ「インクルードタグ/comments template」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています

説明

Loads the comment template. For use in single post and Page displays.

書き方

<?php comments_template( $file, $separate_comments ); ?>

パラメータ

$file
string) (optional) The file to load
初期値: /comments.php
$separate_comments
boolean) (optional) Whether to separate the comments by comment type.
初期値: false

用例

Alternative Comment Template

On some occasions you may want display your comments differently within your Theme. For this you would build an alternate file (ex. short-comments.php) and call it as follows:

<?php comments_template( '/short-comments.php' ); ?> 

Notes

  • Uses global: (array) $comment List of comment objects for the current post
  • Uses: $wpdb
  • Uses: $id
  • Uses: $post
  • Uses: $withcomments Will not try to get the comments if the post has none.

Changelog

Since: 1.5.0

Source File

comments_template() is located in wp-includes/comment-template.php.

最新英語版: WordPress Codex » Function Reference/comments_template最新版との差分

関連項目

インクルードタグ: get_header(), get_footer(), get_sidebar(), get_template_part(), get_search_form(), comments_template()


関数リファレンステンプレートタグ目次もご覧ください。


外部資料