如何去除摘要尾的这个图标?
发表于 : 2021年 1月 30日 17:54
用了别人的代码在首页设置显示摘要,但有图片的文章,在结尾有个超丑的图标,请问怎么可以去除并让“阅读全文”居中?
代码如下
<?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');
if(preg_match('/<pre>/',$c))
{
echo $c,'</code></pre>','...';;
}
else
{
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');
if(preg_match('/<pre>/',$c))
{
echo $c,'</code></pre>','...';;
}
else
{
echo $c.'...';
}
echo '</br><p class="more"><a href="',$this->permalink(),'" title="',$this->title(),'">阅读全文...</a></p>';
}
?>
显示的效果