最近用站长工具查论坛的 SEO 的时候,忽然发现,论坛门户的 KeyWord(关键词) 和 Description(描述)都只剩下门户俩字了。原来 Discuz 对游客屏蔽了关键词与描述。虽然说用管理员账号登陆后,可以正
最近用站长工具查论坛的 SEO 的时候,忽然发现,论坛门户的 KeyWord(关键词) 和 Description(描述)都只剩下门户俩字了。原来 Discuz 对游客屏蔽了关键词与描述。虽然说用管理员账号登陆后,可以正常显示了。不过很难说蜘蛛或Robot是不是可以真正能获取。所以为了收录,还是改回来吧。具体方法为:
找到文件“ source/class/helper/helper_seo.PHP ”这个文件
搜索:
复制代码代码如下:
if($descriptiontext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
$seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
}
if($keywordstext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
$seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
}
修改为:
复制代码代码如下:
if($descriptiontext) {
$seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
}
if($keywordstext) {
$seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
}
OK,最后登出后,再用游客身份查看源代码,已经可以看到 Description 和 Keyword 了,在用站长SEO工具测试一下,也OK了。。
完事大吉!
--结束END--
本文标题: Discuz X3/3.1 门户中的Keyword和Description显示不正确的解决方法
本文链接: https://www.lsjlt.com/news/32430.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-02-29
2024-02-29
2024-02-27
2023-10-27
2023-10-26
2023-10-25
2023-10-21
2023-10-21
2023-10-18
2023-10-12
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0