分类
WordPress代码片断

wordpress有摘要显示摘要没摘要截取一段正文内容

<?php if (has_excerpt()) {
                echo $description = get_the_excerpt();
            }else {
                echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 200,"……"); 
            } ?>