WordPress加载评论模板标签:comments_template

WordPress模板标签comments_template首先会尝试加载评论模板comments.php,如果comments.php不存在,则输出默认的评论区HTML

comments_template( string $file = '/comments.php', bool $separate_comments = false )

Table of Contents

函数参数

$file

字符串值,可选,默认值为/comments.php

可以指定需要加载的评论模板,而不必是comments.php

$separate_comments

布尔值,可选,默认值为false

是否根据评论类型来输出评论,几乎用不到。

comments_template标签通常用在single.php和page.php的主循环中,用来输出评论列表以及评论表单。

扩展阅读

comments_template()函数位于:wp-includes/comment-template.php

相关函数:

原创文章,作者:,如若转载,请注明出处:https://ce.771633.xyz/1494.html

Like (0)
Previous 2025年3月8日
Next 2025年3月8日

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注