我正在修改一些现有代码,并尝试添加用户在单个帖子上留下评论的功能,然后根据批准回送这些评论。我需要在下面添加<?php the_content(); ?>
为了获得评论,我需要在下面添加什么代码?
单个博客帖子中的评论文本区,如果批准,则显示评论
2 个回复
SO网友:user52466
内容下方的右波纹管(单柱)
<?php if (function_exists(\'paged_comments_template\')) paged_comments_template(); else comments_template(); ?>
以及您需要在wordpress面板中更改的批准。SO网友:Brad Dalton
在内容中。php,添加如下代码:
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
?>
<span class="comments-link"><?php comments_popup_link( __( \'Leave a comment\', \'$text_domain\' ), __( \'1 Comment\', \'$text_domain\' ), __( \'% Comments\', \'$text_domain\' ) ); ?></span>
<?php
endif;
在单曲结束之前。php,这:if ( comments_open() || get_comments_number() ) {
comments_template();
}
endwhile;
?>
查看单曲。php和内容。php文件中的214个主题为指南。Moderate comments 使用讨论设置。
结束