Welcome to Delicate template
Header
Just another WordPress site
Header

帝国灵动标签截取字符后面加省略号

5月 27th, 2011 | Posted by 无 名 in ecms

如果字符大于截取字符数,就添加省略号,如果小于这个数,就不截取,不加省略号。
用if判断语句,代码如下:

[e:loop={7,10,0,0}]
<li>·<a href="<?=$bqsr[titleurl]?>" title="<?=$bqr[title]?>" target="_blank">
<?if(strlen($bqr[title])<=24){?>
<?=$bqr[title]?>
<?}else{?>
<?=esub($bqr[title],24,'...')?>
<?}?>
</a></li>
[/e:loop]

You can follow any responses to this entry through the RSS 2.0 Both comments and pings are currently closed.