Skip to content

Commit

Permalink
使自动生成摘要不显示 More 块之后的内容
Browse files Browse the repository at this point in the history
  • Loading branch information
dousha committed Feb 5, 2021
1 parent ee16de1 commit 1726972
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.php
Expand Up @@ -19,7 +19,9 @@
<?php if (post_password_required()) {
the_content();
} else {
echo mb_strimwidth(strip_shortcodes(strip_tags(apply_filters('the_content', $post->post_excerpt ?: $post->post_content))), 0, 220, '...');
$content = get_post_field('post_content', get_the_ID());
$content_parts = get_extended($content);
echo mb_strimwidth(strip_shortcodes(strip_tags(apply_filters('the_content', $post->post_excerpt ?: $content_parts['main']))), 0, 220, '...');
} ?>
</p>
</main>
Expand Down

0 comments on commit 1726972

Please sign in to comment.