織夢文章和圖集里圖片自動ALT注釋為文章標題的
導讀:織夢技巧織夢技巧在織夢目錄里打開 include/arc.archives.class.php 文件 找到 $this-Fields[typename] = $this-Typseo網站排名優化軟件建設網站公司。
在織夢目錄里打開 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[bo […]
在織夢seo網站關鍵詞優化目錄里打開 include/arc.archi網站優化seo培訓ves.class.p網站建設教程hp 文件
找到
$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']);
//圖集模板中的圖片自動添加注釋為標題
$this->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']);
相關seo網站排名優化軟件建設網站公司。聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-25 ,文章織夢文章和圖集里圖片自動ALT注釋為文章標題的主要講述標題,文章,織夢網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_8623.html