现在位置:首页 » 网站建设 »

DZ门户首页关键词和描述显示“首页”的解决方法

时间:2013年05月24日 ⁄ 分类: 网站建设 评论:0

在后台设置SEO后,更新缓存了,门户首页的关键词和描述仍然显示“首页”很郁闷,在网上找了一些资料后,发现需要修改顶部的模板代码,

首先进入DZ后台-然后,全局-seo设置--门户-设置好标题,关键词,描述后如果还是检测不到关键词,就按以下方法:
FTP下载模板文件:template/default/common/header_common.htm

找到以下代码:

 

<meta name="keywords" content="{if !empty($metakeywords)}{echo htmlspecialchars($metakeywords)}{/if}" />
<meta name="description" content="{if !empty($metadescription)}{echo htmlspecialchars($metadescription)} {/if},$_G['setting']['bbname']" />

 

替换为:


<meta name="keywords" content="{if ''==strstr( $_G['setting']['seokeywords']['portal'])} $_G['setting']['seokeywords']['portal'] {/if}" />
<meta name="description" content="{if ''==strstr($_G['setting']['seodescription']['portal'])} $_G['setting']['seodescription']['portal'] {/if}/>

 

保存后覆盖上传,覆盖之前记得先备份一下哦。

覆盖完成后,进入后台更新缓存,然后刷新门户首页,就可以看到和你后台设置的一样了。

 


演示地址:http://bbs.sz836.com/


目前有 0 条评论