discuz x3.3门户出现关键词和描述显示“首页”的解决方法

    Discuz社区在后台设置好门户标题、关键字、描述,更新缓存,发现用户登录状态下,门户首页的关键字和描述正常显示;但在游客状态下不显示,在某工具中查看到的情况是只显示首页,这对SEO是致命打击。

   找到“ source/class/helper/helper_seo.php ”目录下的文件的38行~43行代买,如下:

   

 替换修改成如下代码:

   

if($descriptiontext) {
    $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
}
if($keywordstext) {
    $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
}

  修改完成后,进入后台更新缓存,然后刷新门户首页,就可以正常显示了,完成。

     修改后的演示站点:http://bbs.yuanzhumuban.cc/

原文地址:https://www.cnblogs.com/68xi/p/11582544.html