阅读背景:

wordpress文章摘要调用_一味博客

来源:互联网 

制作模板时需要调用文章自定义摘要可以使用下面代码实现

<?php if (has_excerpt()) {
        echo $description = get_the_excerpt(); //文章编辑中的摘要
    }else {
        echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 170,"……"); //文章编辑中若无摘要,自定截取文章内容字数做为摘要
    } ?><?php if (has_exce



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: