洞悉互聯(lián)網(wǎng)前沿資訊,探尋網(wǎng)站營銷規(guī)律
作者:Smileby陌少羽 | 2019-04-08 16:35 |點擊:
大部分手機站都是自適應(yīng)的,這樣圖片就不能有寬高限制,我們添加文章圖片時很多時候都會有width height style這些屬性在里面,在手機站上要把它們清除,又不能影響電腦站的,不修改程序內(nèi)核文件,我們可以在手機版內(nèi)容頁模板里,
把手機站內(nèi)容頁模板把調(diào)用文章內(nèi)容的標(biāo)簽
{dede:field.body/}
改成
{dede:field.body runphp=yes}
global $cfg_basehost;
$str = @me;
$search = '/(
$search1 = '/(
$search2 = '#()#i';
$search3 = '#()#i';
$content = preg_replace($search,'$1$3',$str);
$content = preg_replace($search1,'$1$3',$content);
$content = preg_replace($search2,'$1$2',$content);
$content = preg_replace($search3,'$1$2',$content);
@me = str_replace('/uploads/allimg/', $cfg_basehost.'/uploads/allimg/', $content);
{/dede:field.body}