comments_template標籤是方便我們在wordpress網站中調用評論文件comments.php的,如果在主題當中沒有comments.php文件,標籤會自動獲取程序路徑wp-includes/theme-compat/comments.php的默認評論模塊,在模板製作中我們使用以下標籤進行調用:
<?php comments_template( $file, $separate_comments ); ?>
其中的$file參數是指可以導入不同的評論文件的,例如:我們在主題中創建一個 comments-other.php 文件,我們可以通過以下代碼進行調用:
<?php comments_template( '/comments-other.php' ); ?>