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

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

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

提供: WordPress Codex 日本語版
移動先: 案内検索
(テンプレガイド挿入等)
(最新英語版を反映)
2行目: 2行目:
 
{{テンプレートタグガイド|PHP}}
 
{{テンプレートタグガイド|PHP}}
  
 +
<div id="Description">
 
== 説明 ==
 
== 説明 ==
 +
Loads the comment template. For use in single [[Writing_Posts|Post]] and [[Pages|Page]] displays.
 +
</div>
  
Loads the comment template.  For use in single post and [[Pages|Page]] displays.
+
<div id="Usage">
 
+
== 使い方 ==
== 書き方 <span id="Usage"></span>==
+
 
  <?php comments_template( $file, $separate_comments ); ?>
 
  <?php comments_template( $file, $separate_comments ); ?>
 +
</div>
  
== パラメータ <span id="Parameters"></span>==
+
<div id="Parameters">
 +
== パラメータ ==
 
{{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}}
 +
</div>
  
== 用例 <span id="Examples"></span>==
+
<div id="Examples">
 +
== 用例 ==
 +
Default Usage
 +
<pre>
 +
<?php comments_template(); ?>
 +
</pre>
  
===Alternative Comment Template <span id="Alternative_Comment_Template"></span>===
+
===Alternative Comment Template===
 
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:
  
21行目: 31行目:
 
<?php comments_template( '/short-comments.php' ); ?>  
 
<?php comments_template( '/short-comments.php' ); ?>  
 
</pre>
 
</pre>
 +
</div>
  
 +
<div id="Notes">
 
==Notes==
 
==Notes==
 
* Uses global: (array) $comment List of comment objects for the current post
 
* Uses global: (array) $comment List of comment objects for the current post
28行目: 40行目:
 
* Uses: $post
 
* Uses: $post
 
* Uses: $withcomments Will not try to get the comments if the post has none.
 
* Uses: $withcomments Will not try to get the comments if the post has none.
 +
</div>
  
==Changelog==
+
<div id="Changelog">
 +
==変更履歴==
 
Since: 1.5.0
 
Since: 1.5.0
 +
</div>
  
 +
<div id="Source_File">
 
==Source File==
 
==Source File==
 
<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}}.
  
{{原文|Function Reference/comments_template|92979}}<!-- 11:28, 15 September 2010 bono 版 -->
+
</div>
  
 +
<div id="Available_Filters_and_Actions">
 +
==Available Filters and Actions==
 +
[http://codex.wordpress.org/Plugin_API/Filter_Reference#Comment.2C_Trackback.2C_and_Ping_Filters List of comment filters and actions]
 +
</div>
 +
 +
<div id="Parameters">
 
== 関連項目 ==
 
== 関連項目 ==
 +
[[関数リファレンス/comment_form|comment_form()]]
  
 
{{Include Tags}}
 
{{Include Tags}}
 
{{Tag Footer}}
 
{{Tag Footer}}
 +
</div>
 +
 +
{{原文|Function Reference/comments_template|120367}}<!--  02:17, 20 July 2012 Adiant 版 -->
  
 +
<div id="External_Resources">
 
== 外部資料 ==
 
== 外部資料 ==
  
 
<!-- 参考になるページがあればリンクを -->
 
<!-- 参考になるページがあればリンクを -->
 +
</div>
  
 
{{DEFAULTSORT:Comments_template}}
 
{{DEFAULTSORT:Comments_template}}

2013年1月16日 (水) 11:25時点における版

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

使い方

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

用例

Default Usage

<?php comments_template(); ?>

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.

変更履歴

Since: 1.5.0

Source File

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

Available Filters and Actions

List of comment filters and actions

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

外部資料