wordpress不用插件,不用More标签,只需要简单的一句echo即可随意限定摘要显示多少字
标题部分:
<em><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></em>
摘要部分:
<?php if(!is_single()) {
echo mb_strimwidth(strip_tags($post->post_content),0,240,'......');
} ?>
<span class="date"><a href="<?php the_permalink() ?>">SEO全文 »</a></span>
显示效果:
网络推广经验,欢迎分享:广州SEO,网络推广 » Wordpress自定义摘要显示字数