参考链接:https://blog.csdn.net/etx2002/article/details/51454627
<?php
echo wp_trim_words( get_the_title(),50);// 截取50字的文章标题
echo wp_trim_words( get_the_excerpt(),100);// 截取100字的文章摘要
echo wp_trim_words( get_the_content(),500);// 截取500字的文章内容
?>
参考链接:https://blog.csdn.net/etx2002/article/details/51454627
<?php
echo wp_trim_words( get_the_title(),50);// 截取50字的文章标题
echo wp_trim_words( get_the_excerpt(),100);// 截取100字的文章摘要
echo wp_trim_words( get_the_content(),500);// 截取500字的文章内容
?>