1. 首页 >> 焦点

dedecms织梦网站若何设置图片主动添加alt属性

独霸dedecms建的织站若置图站默许不会给图片添加alt属性 ,但图片的梦网alt属性却很次要,上面给出编制让织梦模板主动给图片添加alt。何设

代开文件/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,}[sS]{ 0,}["'s] @isU"," ",$this->Fields['body']); 
$this->Fields['body'] = str_ireplace("Fields['title']."" ",$this->Fields['body']);


在布景从头生成html文件就会奏效了 。

属性


版权声明:行行出状元网 ,转载请注明出处:https://www.v8q.cn/html/56b6199882.html

 
QQ在线咨询
售前咨询热线
020-123456789
微信号
020-123456789