comments_template()

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

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

$file

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

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

$separate_comments

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

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

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

扩展阅读

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

相关函数:

get_header()
get_sidebar()
get_template_part()
get_search_form()
get_footer()

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索