织梦dedecms给图片添加Alt和Title属性

织梦dedecms给图片添加Alt和Title属性,第1张

织梦dedecms给图片添加Alt和Title属性 搜索引擎对织梦dedecms图片的认知就是图片添加的属性,在织梦后天上传图片的时候是不会添加属性的,虽然也有title选项,但是是没有效果的,想要添加属性还要在配置文件中做出相应的修改。
打开include/arc.archives.class.php文件
找到以下代码(一般在第204行):
//设置全局环境变量
$this->Fields['typename'] = $this->Typelink->TypeInfos['typename'];
@SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives');
}
//完成附加表信息读取
unset($row);
然后在
@SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives'); 
下面添加以下代码(“织梦中国网”就是你想要更换的图片名称):
$this->Fields['body'] = str_ireplace("Fields['title'].",织梦中国网' ",$this->Fields['body']);
$this->Fields['imgurls'] = str_ireplace("Fields['title'].",织梦中国网' ",$this->Fields['imgurls']);
$this->Fields['introduce'] = str_ireplace("Fields['title'].",织梦中国网' ",$this->Fields['introduce']);

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/3007934.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-09-27
下一篇 2022-09-27

发表评论

登录后才能评论

评论列表(0条)

保存