wordpress评论
评论模板文件:comments.php
函数
comments_template()函数
描述:调用评论模板文件
<?php
comments_template();
comments_open()函数
描述:获取当前文章是否开启评论功能
<?php
if(comments_open();){
true
}else{
false
}
have_comments()函数
描述:判断是否有评论
if(have_comments()){
true
}else{
false
}
post_password_required()函数
描述:判断当前文章是否需要密码并且正确输入
<?php
if(have_comments()){
true
}else{
false
}
wp_list_comments()函数
描述:输出当前文章所有评论
<?php
wp_list_comments();
is_user_logged_in()函数
描述:判断用户是否登录
<?php
if(is_user_logged_in()){
true
}else{
false
}
comment_form()函数
描述:输出评论窗口
<?php
comment_form();

浙公网安备 33010602011771号