wp_get_current_commenter()函數(shù)可以獲取當(dāng)前的評論者姓名、郵箱和URL的值,可以用在fields表單內(nèi)的value字段顯示
語法
<?php wp_get_current_commenter() ?>
參數(shù)
返回一個(gè)數(shù)組
Array (
['comment_author']
=> 'name',
['comment_author_email']
=> 'email',
['comment_author_url']
=> 'url'
)
comments_template ()函數(shù)用來加載評論模板。只能用于單篇文章或頁面來顯示評論,如果不是這些頁面,將沒辦法顯示。
語法結(jié)構(gòu)
<?php comments_template( $file, $separate_comments ); ?>
參數(shù)
$file (字符串string) (可選) 要加載的文件 默認(rèn): comments.php
$separate_comments (布爾值boolean) (可選) 是否根據(jù)評論的類型劃分評論 默認(rèn): false