马春杰杰 Exit Reader Mode

增加Typecho的评论嵌套层级数量

使用typecho的时候会发现,评论的嵌套层数最大只能嵌套7层,再多了就不行了,即使后台设置100,一刷新仍然是7

修改方法:

打开主题下的functions.php,然后找到function themeInit($archive) 这句话,在这个函数中加一句:

Helper::options()->commentsMaxNestingLevels = 100;

这样就可以了。

function themeInit($archive) {
    Helper::options()->commentsMaxNestingLevels = 100;

	$options = Helper::options();
	$options->commentsAntiSpam = false;
	if ($options->PjaxOption || FindContents('page-whisper.php', 'commentsNum', 'd')) {
		$options->commentsOrder = 'DESC';
		$options->commentsPageDisplay = 'first';
	}
	if ($archive->is('single')) {
		$archive->content = hrefOpen($archive->content);
		if ($options->AttUrlReplace) {
			$archive->content = UrlReplace($archive->content);
		}
		if ($archive->fields->catalog) {
			$archive->content = createCatalog($archive->content);
		}
	}
}

 

本文最后更新于2021年6月21日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!