织梦dedecms将文章和图集里图片的ALT注释修改为文
导读:dedecmsdedecms打开 include/arc.archives.class.php 文件 找到 $this-Fields[typename] = $this-TypeLink-dede模板堂dede免费校板下战。
打开 include/arc.archives.class.php 文件 找到 $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename']; @SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives'); 在其下边添加 //文章模板中的图片自动添加alt属性为标题 $this->Fields['body'] = str_ireplace(array('alt=""','alt=\'\''),'',$this模板织梦->Fields['body']); $this->Fields['body'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU"," ",$this->Fields['body']); $this->Fields['body'] = str_ireplace("<img " ,"<img alt=\"".$this->Fields['title']."\" ",$this->Fields['body']); //图集模板中的图片自动添加注释为标题 $thdede商城模板is->Fields['imgurls'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['imgurls']); $this->Fields['imgurls'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU"," ",$this->Fields['imgurls']); $this->Fields['imgurls'] = str_ireplace("<img " ,"<img alt=\"".$this->Fields['title']."\" ",$this->Fields['imgurls']); 相关dede模板堂dede免费校板下战。
声明: 本文由我的SEOUC技术文章主页发布于:2023-07-18 ,文章织梦dedecms将文章和图集里图片的ALT注释修改为文主要讲述标题,文章,织梦网站建设源码以及服务器配置搭建相关技术文章。转载请保留链接: https://www.seouc.com/article/web_29761.html