之前也有发过类似的代码。效果几乎都差不多 代码片段 <?php if (has_excerpt()) { echo $description = get_the_excerpt(); //文章编辑中的摘要 }else { echo mb_strimwidth(strip_tags(apply_filters(\'the_content\', $post->post_content)), 0, 170,\"……\"); //如果文章没有摘要,自定截取文章内容字数做为摘要 } ?> 0 0 wordpress文章内容文章摘要
评论0