wordpress纯代码不用插件实现首页摘要自动截取样式
带图片输出 <?php if(preg_match('/<!--more-->/',$this->content)||mb_strlen($this->content, 'utf-8') < 270) { $this->content('阅读全文...'); } else { $c=mb_substr($this->content, 0, 270, 'utf-8'); echo $c.'...'; echo '</br><p class="more"><a href="',$this->permalink(),'" title="',$this->title(),'">阅读全文...</a></p>'; } ?> 不带图片输出: <?php if(preg_match('/<!--more-->/',$this->content)||mb_strlen($this->content, 'utf-8') < 270) { $this->content('阅读全文...'); } else { $c=mb_substr($this->content, 0, 270, 'utf-8'); $c=preg_replace("/<[img|IMG].*?src=[\'\"](.*?(?:[\.gif|\.jpg|\.jpeg|\.png|\.tiff|\.bmp]))[\'|\"].*?[\